Skip to content

Application Logging

Logging within Assure1 is an extremely important way to monitor the application as well as troubleshoot and debug the various actions completed by the applications. There are six logging levels built into the Assure1 applications:

  • DEBUG

  • INFO

  • WARN

  • ERROR

  • FATAL

  • OFF

The default logging level for most applications is ERROR.

The logging levels recognized by the Message function (which is used within the application logic and rules files) are DEBUG, INFO, WARN, ERROR, FATAL and ALWAYS.

  • If the application is using the DEBUG log level, logging messages with the DEBUG, INFO, WARN, ERROR, FATAL or ALWAYS tags will be written to the log file.

  • If the application is using the INFO log level, logging messages with the INFO, WARN, ERROR, FATAL or ALWAYS tags will be written to the log file.

  • If the application is using the WARN log level, logging messages with the WARN, ERROR, FATAL or ALWAYS tags will be written to the log file.

  • If the application is using the ERROR log level, logging messages with the ERROR, FATAL or ALWAYS tags will be written to the log file.

  • If the application is using the FATAL log level, logging messages with the FATAL or ALWAYS tags will be written to the log file.

  • If the application is using the OFF log level, logging messages with the ALWAYS tag will be written to the log file.

Changing the Logging Level

  1. Change the logging level to DEBUG for the application. All applications have an application configuration that controls the logging level that is used.

    1. Navigate to the Jobs or Services UI.

    2. Find and select the application that is used by the application.

    3. Change the LogLevel option to DEBUG and click Submit.

  2. Restart the application to start using the new logging level, or use the Reload Config functionality.

  3. Analyze the log files to determine where the error is occurring.

  4. Modify the rules to fix the issue.

  5. Repeat Step 1, changing the logging level back to ERROR.

  6. Restart the application to start using the new logging level, or use the Reload Config functionality.

Logging Examples

Below are examples of how to utilize the logging function within an Assure1 rules file.

Single Line Example

$Log->Message("DEBUG", "Show a variable - " . $SomeVariable);

Multi-Line Example

$Log->Message('DEBUG', [
    '#===============================================',
    '# Log Line1',
    '# Log Line2',
    '# Show variable 1 - ' . $SomeVariable1,
    '# Show variable 2 - ' . $SomeVariable2,
    '#==============================================='
]);