Add log messages to the scripts in your PowerShell step. Use log levels for improved
logging and debugging.
시작하기 전에
To add log messages to your script, you will need to use the
Write-SNCLog function. This function is defined in the
IH\Logging.psm1 module. Use PSScript.ps1 to import this module so inline scripts
have access to Write-SNCLog. For more information, see MID Server PowerShell
files.
Role required: admin
프로시저
-
Navigate to .
-
Set mid.property.powershell.log_info to true.
-
Set mid.property.powershell.ih.log_level to the desired log level.
The log level specifies the threshold required to log a message. Messages are logged at the specified level or higher. For example, if this property is set to WARN, then messages with a level of WARN or ERROR are logged.
Messages with a level of INFO, DEBUG, or TRACE are not logged. The levels, listed from low to high, are:
The default value is INFO.
- 옵션:
Configure a system property so that you can view the logs in the instance.
-
Navigate to .
-
Find Specify the log level of system log entries to replicate to the flow log. The system only replicates log entries of the specified level or higher and set it to INFO
or DEBUG.
After the you build and execute the PowerShell script, the logs are available in the MID agent log. Configuring this property also enables you to view them directly in the instance.
This step sets the com.glide.hub.flow_engine.listener_trace.threshold property. It replicates the logs to the Flow engine log entries [sys_flow_log] table.
-
In your PowerShell script, add log messages and levels with the Write-SNCLog function.
-
Continue building your action or flow, then test and run it.
다음에 수행할 작업
The new logs are available in the MID agent log and can be downloaded from the MID
Server. For more information, see Download the MID Server
files.
If you set the system property to view the logs in the instance, you can see them in
the Flow engine log entries tab of the Flow engine context
record. For more information, see Flow execution
details.