Log messages that are defined in an ABL class are processed by the Logger based on configurations in a logging.config file.

Where to put the logging.config file

You need to create the logging.config file manually and write logging configurations in it in JSON format. The file should be placed in the ABL application's PROPATH. The Logger uses only the first logging.config file that it finds in the ABL application's PROPATH, so logging configurations for all ABL classes in an ABL application must be written in the same logging.config file.

Structure of the logging.config file

The logging.config file must begin with a JSON object named logger. Under this root object, you can create as many logging configurations as you need.
{
  "logger": {
      "my.ABL.class.1": {},
      "my.ABL.class.2": {},
      "my.ABL.class.3": {}
  }
}
Each logging configuration has a name (my.ABL.class.1, my.ABL.class.2,... in this example). This name is used when instantiating the Logger using the LoggerBuilder:GetLogger() method in an ABL class.

Inside each logging configuration, you define two things—a logLevel and an array of filters, as shown in this example:

{
  "logger": {
      "my.ABL.class.1": {
          "logLevel": "INFO",
          "filters": [
             "FULL_TEXT_FORMAT",
             {
               "name": "NAMED_FILE_WRITER",
               "fileName": "Class1.log",
               "appendTo": true
             }
          ]
      },
      "my.ABL.class.2": {...},
      "my.ABL.class.3": {...}
  }
}
To learn more about log levels, see Log levels. To learn more about filters, see Log filters.

Logging behavior when no logging.config file is found

If no logging.config file is found, the Logger framework acts as follows:
  • For applications where the Log-Manager is in use, such as applications deployed on PAS for OpenEdge, the Logger framework builds a logger with the following filters:
    • STACK_WRITER_FORMAT
    • ABL_SUBSTITUTE_FORMAT
    • ERROR_FORMAT
    • LOG_MANAGER_FORMAT
    • LOG_MANAGER_WRITER

      For a description of each of these filters, see Log filters.

  • For applications where the Log-Manager is not in use, the Logger framework builds a logger with a VOID_WRITER filter that acts as a sink for log events.