WriteLog

This activity allows the user to print or log the robot's activities based on the
chosen log level during runtime.

This feature proves invaluable for debugging and troubleshooting, as higher
log levels provide more granular insights into the execution flow, while lower
levels offer a more concise overview.

Technical Reference

 

 

 

 

 

 

 

INPUT

InputString: This parameter indicates to provide the “Input” value or variable to print the output during execution.

 

You have the option to either hardcode the values in the "String” variable or pass the values as “String” datatype.

 

This accepts only the “String” datatype.

LogLevel: The Log Level drop-down has multiple options to choose from and they are as follows:

·         Info

·         Trace

·         Fatal

·         Error

·         Debug

·         Warning

·         Off

Depending on the selected option, the message is displayed only at that log level.

You can also either hardcode the values in "String" datatype or enter the values in "String" format. 

Refer below in the documentation to get further information.

MISC

Display Name: Displays the name of the activity. The activity name can also be customized to help in troubleshooting.

SkipOnError: Specify the Boolean value as “True or False.”
True: Continues to execute the workflow irrespective of any error thrown.
False: Stops the workflow if it throws any error.
None: If the option is specified as blank, by default the activity will perform the “False” action.

Version: It indicates the version of the feature being used.

OUTPUT

Result: It helps to view the execution state of the activity. It returns the values in Boolean format.
True: It indicates that the activity has been executed successfully without any error.
False: It indicates that the activity has been unsuccessful due to some unexceptional error thrown.

* Represents mandatory fields to execute the workflow.

Types of Log Levels

Log levels refer to the severity or granularity of messages recorded in logs during
the execution of a program, system, or automation process. They help categorize
and prioritize the information based on its significance. Commonly, log levels are
defined as follows:

1.       Info: This log level provides information regarding the initiation and conclusion
of the workflow execution. If the user selects the info log level, any errors,
warnings, and fatal errors encountered will be captured.

2.       Trace: The Trace level enables the user to capture every individual action
or step executed by the robot, including step-by-step information. Choosing
the trace level traces Info, Debug, and the subsequent levels.

3.       Debug: For detailed initiation and completion information of activities,
excluding system details, choose the Debug level. Information, Warning, and
the following levels will be captured (if present) when selecting the Debug
level. All log levels, except for trace, will be displayed.

4.       Warn: Set the “Warn” level in instances where an exception does not impede
processing but requires attention. Similar to other log levels mentioned earlier,
Warning will also capture the following levels, such as Error.

5.       Error: In certain runs, certain parts of the workflow may execute, while others
may not be due to errors. Users can set Error to investigate where, why, and
how the mistake occurred.

Here’s an example of how “Writelog” activity works –

In the following example, I am continuing from the “InputBox” example, using the
“Writelog” activity, I am going to display the output of the activity.

1.       Open and existing solution.

2.       Drag and drop the “Writelog” activity below the “InputBox”.

3.       Double click on the activity.

a.       Here I am providing the “InputString” as “CredentialOutput(0).ToString” to
display the “Username” provided by the username.

b.       Since the output is the “ListOfString” , we need to mention the (0) to display
the output. The index number starts from (0).

c.       The “.ToString” is advised to use along with any other data types other than
string format. It converts any data type into string.

4.       Then, moving to the “LogLevel” and specifying the log level as “Info”.

5.       Now, execute the workflow.  

Below is the sample output of the activity.