Print

WriteToSystemLog()

The WriteToSystemLog() function will write a message to AMODIT system log. Optionally a message priority or an additional call stack can be specified.

CAUTION! Since AMODIT 230930 edition you have to switch on the EnableWriteToSystemLog parameter in the system settings ([5] on the picture below) in order to use this function.

Syntax

WriteToSystemLog(message);
WriteToSystemLog(message,priority);
WriteToSystemLog(message,priority,callStack);

Function arguments

  • message – (String) a message which will be written to the system log;
  • priority – (String) [optional] a priority of the log (this can have value equal to 1 – error or 2 – info);
  • callStack – (String) [optional] a call stack which will be written to the system log.

Return value

The WriteToSystemLog() function returns Boolean.
Returns true if function was successful, false if there was an error and nothing was written to the system log.

Examples

Example 1

This will write words 'Test log message’ to the system log.

WriteToSystemLog("Test log message");

Example 2

This will write words 'Test log message’ to the system log and set the message priority to 2.

WriteToSystemLog("Test log message",2);

Example 3

This will write words 'Test log message’ to the system log and set the message priority to 2 and add 'ExampleStack’ to the system log message.

WriteToSystemLog("Test log message",2,"ExampleStack");
Czy artykuł był pomocny?
0 na 5 gwiazdek
5 Stars 0%
4 Stars 0%
3 Stars 0%
2 Stars 0%
1 Stars 0%
5
How can we improve this article?
How Can We Improve This Article?