Skip to page contentSkip to chat
ServiceNow support
    • Community
      Ask questions, give advice, and connect with fellow ServiceNow professionals.
      Developer
      Build, test, and deploy applications
      Documentation
      Find detailed information about ServiceNow products, apps, features, and releases.
      Impact
      Accelerate ROI and amplify your expertise.
      Learning
      Build skills with instructor-led and online training.
      Partner
      Grow your business with promotions, news, and marketing tools
      ServiceNow
      Learn about ServiceNow products & solutions.
      Store
      Download certified apps and integrations that complement ServiceNow.
      Support
      Manage your instances, access self-help, and get technical support.
Workflow Logging Overview - Support and Troubleshooting
  • >
  • Knowledge Base
  • >
  • Support and Troubleshooting (Knowledge Base)
  • >
  • Workflow Logging Overview
KB0538547

Workflow Logging Overview


20354 Views Last updated : Sep 21, 2024 public Copy Permalink English (Original)
  • English (Original)
  • Japanese
KB Summary by Now Assist

Issue

Workflow Logging Overview


Goals

  • Introduction to Workflow Logging
  • Logging from the Engine
  • Logging from the Activity
  • Writing customized Log messages in Script


Summary

The Workflow Engine provides configurable logging options using the Workflow Properties.

Log messages indicate their source of the message. A Message log entry comes from either the ENGINE or from within an ACTIVITY.

Log entries can be made into the Context Workflow Log using the Log Message Activity, the Log Trace Activity, and directly through JavaScript.

As the Workflow logging gets more verbose, the list filter is a quick way to locate messages. 

Resolution

Logging in ServiceNow Workflow

ServiceNow Workflow provides logging in a log exclusive to workflows. It is separate from the System log that is specific to a currently executing Workflow Context.

Logging is useful for debugging and tracing progress through a workflow.

ServiceNow Workflow is part of the Glide Script Engine and is invoked with the insert, update, delete or cancel of a Glide record. Log entries in the Workflow Log indicate whether they were entered from the Engine or from the Activity.

The level of logging present in the Workflow Context is configurable by properties. 

  

Add a log message activity


The first exercise demonstrates the default logging behavior in the workflow. 

  1. Return to the Workflow Editor by re-selecting the ServiceNow tab.
  2. Click New on the workflow canvas header.
  3. Fill out the form as follows.

    Name K14 Logging Demo.

    Table: Global.
     
  4. Click the Submit button.


     
  5. Expand the Utilities folder of the Activities Tree.
  6. Find the Log Message Activity in the Utilities folder.
  7. Hold the mouse down and drag the Activity onto the canvas.
  8. Hover the Activity over the transition line until the line turns blue.
  9. Release the mouse. The New Activity form displays.
  10. Fill out the form as follows.

    Name: K14 Log Message
    Message: This is a message in the Log Message Activity.


     
  11. Click the Submit button. 

    Your workflow should look like this:


     
  12. Find the Log Trace Message Activity in the Utilities folder.
  13. Hold the mouse down and drag the Activity onto the canvas.
  14. Hover the activity over the transition line between Log Message and End until the line turns blue.
  15. Release the mouse.
  16. Fill out the form as follows:

    Name K14 Log Trace Message.
     
  17. Click Submit.

    Your workflow should look like this:


     
  18. Find the Run Script Activity in the Utilities folder.
  19. Hold the mouse down and drag the Activity onto the canvas.
  20. Hover the activity over the transition line between the Log Trace Message and End Activities until the line turns blue.
  21. Release the mouse.

    Fill out the form as follows:

    Name: K14 Log Message from inside Run Script
    Script:
    workflow.debug(‘Logging DEBUG from inside a script’);
    workflow.info(‘Logging INFO from inside a script’);

     
  22. Click the Submit button.

    Your workflow should look like this:


     
  23. Click the green Play button in the header of the canvas.


     
  24. Click the Submit button.



    QUESTION: What does the blue coloring of the activities tell us? 


Review logging output


  1. Return to the main ServiceNow tab. 
  2. In the Applications Select the All Contexts module in the Workflow. 


     
  3. Select the Workflow Execution: K14 Logging Demo context.


     
  4. Select the Workflow Log tab.

    Notice the Source column:



    • ENGINE is a message that is coming from within the Workflow Engine.
    • ACTIVITY is a message that is coming from the JavaScript within a Workflow Activity.

    Notice the messages:


     

    (1) The first ACTIVITY message is the output of the Log Message Activity.
    (2) The next three messages are the output of the Trace Message Activity. The Trace Message Activity logs the name assigned to the Activity, the event that the workflow is transitioning on, and the ID of the Workflow Context.
    (3) The third message is the INFO message written in the Script field of the Run Script activity.

    QUESTION: What message is missing from this log?

    The level of verbosity in the Workflow Log is configurable by properties.
     
  5. Workflow > Properties.


     
  6. Check the property Log details of workflow actions. This property sets the level of log messaging.
  7. Check Log workflow debug messages. It sets the level of log messaging while debugging is activated.
  8. Return to the Workflow Editor and close the tab.
  9. Open the K14 Logging Demo workflow. Note that the workflow is Checked out.
  10. Re-execute the workflow using the green Play arrow.

  11. Return to the main ServiceNow tab.
  12. Workflow > All Contexts.
  13. Find and select the most recently run K14 Logging Demo workflow.
  14. Select the Workflow Log tab.

    Your list should look like this:



    NOTE: The Actual number of Workflow Log messages will vary.

    Notice:
    • The dramatic increase in Workflow Log entries.
    • The mix of Debug and Information messages.
    • How much information is coming from the ENGINE!
     
     

Search the list for run script logging

Do these next steps using the List filter. 

  1. Select: Go to Message.
  2. Type: from Run Script.


     
  3. Click the Search icon (magnifying glass).

    Your list should look like this:



    Notice the previously missing Debug message from the Run Script Activity is now in the Workflow Log.
     

NOTE:  The Workflow Logging Properties apply to all running Contexts. Use them only when needed for debugging or testing to optimize performance on your instance. 



The world works with ServiceNow.

Sign in for more! There's more content available only to authenticated users Sign in for more!
Did this KB article help you?
Did this KB article help you?

How would you rate your Now Support digital experience?

*

Very unsatisfied

Unsatisfied

Neutral

Satisfied

Very satisfied

Very unsatisfied

Unsatisfied

Neutral

Satisfied

Very satisfied

What can we improve? Please select all that apply.

What are we doing well? Please select all that apply.

Tell us more

*

Do you expect a response from this feedback?

  • Terms and conditions
  • Privacy statement
  • GDPR
  • Cookie policy
  • © 2025 ServiceNow. All rights reserved.