3.3.22. Logging

The following preferences enable you to specify whether or not to create a log file from within the application as well as to refine the type of information collected by the log file and to define the directory where the log file is saved.


Note:  If you specify an environment variable to create log files, the environment variable(s) will always override the following preference settings.


PreferenceDescription

Enable Logging

Specify whether or not to create log files. Options include On and Off (default).

Set Logging Level

Specify the type of statements the application saves to the log file. Options include:

  • Trace (Most): Save all application generated statements.

  • Debug: Save debug messages as well as all messages for the each of the items listed below (Information, Warning, Error, and Fatal).

  • Information (default): This default setting saves Information messages as well as all messages for the each of the items listed below (Warning, Error, and Fatal).

  • Warning: Save Warning messages as well as all messages for the each of the items listed below (Error, and Fatal).

  • Error: Save Error messages as well as all messages for the item listed below (Fatal).

  • Fatal Only (Least): Save fatal error messages only.

Set Logging Directory

Specify a directory where the application writes the log files.

Supported Environment Variables

You can also use the following environment variables to generate log files. These environment variables override the above preference settings.

  • ANSYS_WORKBENCH_LOGGING=1: Enable (1) or disable (0) the creation of log files.

  • ANSYS_WORKBENCH_LOGGING_BASE_DIRECTORY=C:\AnsysLogs: Specify a directory where the application writes the log files.

  • ANSYS_WORKBENCH_LOGGING_FILTER_LEVEL=0: Specify the type of statements the application saves to the log file. Variable values include:

    • Trace = 0

    • Debug = 1

    • Information = 2

    • Warning = 3

    • Error = 4

    • Fatal = 5

  • ANSYS_WORKBENCH_LOGGING_AUTO_FLUSH=1: Information is written to the log file immediately instead of being cached. This has a slight affect on performance but ensures all information is captured in the log file in the event of a program crash. If this environment variable is not set, the default behavior is 1.