The AMT Job Control Language (JCL) Python library uses Python's built-in logging module. The logging module is part of the Python standard library and provides a way to configure different loggers, handlers, and formatters. This means that every module in the JCL library can have its own logger, based on the module's name. This way it is easy to identify where log messages are coming from.
The Python logging module is configured using a configuration file, which describes the default behavior of the logging system. The location of the JSON configuration file can be set using the AMT_JCL_LOG_CONFIG environment variable.
The file path pointing to the location of the JCL logging file can be set using the AMT_JCL_LOG_CONFIG environment variable. Follow the instructions below for Windows or Linux.
sudo <text editor> /etc/environment.
AMT_JCL_LOG_CONFIG="<value>".echo $AMT_JCL_LOG_CONFIG to verify the variable has been set
successfully.OpenTelemetry (OTEL) is a set of tools and standards that helps to collect and analyze performance data in AMT applications. OpenTelemetry tracks metrics, traces, and logs detailed event records. This information allows for a better understanding of applications, troubleshoot issues, and enhance user experiences.
Usage of OpenTelemetry is optional and it is disabled by default. To enable OpenTelemetry, configure the following settings in the jcl-config.json file. See the configuration example below:
"otel_collector_host": "localhost",
"otel_collector_port": "4317"The following settings are available in the jcl-logging.conf file:
| Setting | Values | Description | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| level |
DEBUG INFO WARNING (default) ERROR CRITICAL |
Sets the level of logging.
|
||||||||||||||||||||
| class | <class> | Indicates the handler's class | ||||||||||||||||||||
| formatter | <formatter> |
Indicates the key name of the formatter for this handler. Formats can be customized in the
[formatter_<format_name>] section, for example:
|
||||||||||||||||||||
| args |
|
The list of arguments to the constructor for the handler class. This is evaluated in the context of the
logging package's namespace. If a log folder location was specified but does not exist, the folder
is automatically created. Example usage of arguments:
|
[loggers]
keys=root
[handlers]
keys=console,file
[formatters]
keys=jcl_log_formatter
[logger_root]
level=DEBUG
handlers=console,file
[handler_console]
level=WARNING
class=StreamHandler
formatter=jcl_log_formatter
args=(sys.stdout,)
[handler_file]
class=amt_jcl.amt.jcl.amt_logging.handlers.JclRotatingFileHandler
formatter=jcl_log_formatter
args=('./logs/job_summary.log', 'a', 1048576, 10)
[formatter_jcl_log_formatter]
format=[%(asctime)s] [%(levelname)s] [%(name)s] %(message)s