Write logging configurations in a logging.config file
- Last Updated: April 29, 2024
- 2 minute read
- OpenEdge
- Version 12.8
- Documentation
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. TheLogger 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
Thelogging.config file must begin with a JSON object named
logger. Under this root object, you can create as
many logging configurations as you need.
|
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:
|
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-Manageris in use, such as applications deployed on PAS for OpenEdge, the Logger framework builds a logger with the following filters:STACK_WRITER_FORMATABL_SUBSTITUTE_FORMATERROR_FORMATLOG_MANAGER_FORMATLOG_MANAGER_WRITERFor a description of each of these filters, see Log filters.
- For applications where the
Log-Manageris not in use, the Logger framework builds a logger with aVOID_WRITERfilter that acts as a sink for log events.