Configuring SBA Gateway Logging
SBA Gateway uses log4j2 to configure logging. You can change or override the default log4j2 settings using environment variables.
Logging
You can use the following environment variables to change basic logging settings
without providing a new log4j2.xml file:
- MTX_LOG_DIR — The default value for the logging directory is /var/log/mtx.
- MTX_LOG_FILENAME — The file containing the logging information. The file is specific to the pod.
- MTX_SBA_LOG_LEVEL — The logging level for which to capture logging details. Possible values are DEBUG, WARN, ERROR, INFO, and TRACE. The default value is INFO.
- MTX_SBA_DMM_LOG_LEVEL — The logging level to capture logging details of 5G messages from MATRIXX Engine. Possible values are DEBUG, WARN, ERROR, INFO, and TRACE. The default value is INFO.
- MTX_SBA_LOG_VERBOSE — The setting to specify the logger, for example, OpenTelemetry, and capture verbose logging information about the usage of underlying
networking libraries. Possible values are DEBUG, WARN, ERROR, INFO, and TRACE. The following example specifies OpenTelemetry as the logger, and WARN as the default logging
level:
<Logger name="io.opentelemetry" level="${sys:MTX_SBA_LOG_VERBOSE:-${env:MTX_SBA_LOG_VERBOSE:-warn}}"/>
Note: If the MTX_SBA_LOG_VERBOSE environment variable is not specified, the logging level defaults to the following, depending on the logger being used:io.vertx
— INFOio.netty
— INFOio.opentelemetry
— WARN
- MTX_SBA_KAFKA_LOG_LEVEL — The Apache Kafka logging level for which to capture logging details. Possible values are DEBUG, WARN, ERROR, INFO, and TRACE. The default value is WARN.
- MTX_LOG_MECHANISM — The log4j2 appender to use for the logging. The default value is file.
Size-based Triggering Policy
By default, SBA Gateway-related containers rotate log files once they reach a specified size:
- CHF
- Router
- Streamer
- Sink
- Replay
- SBA Load Generator
- SNMP Adapter
Log Rotation Environment Variables describes the environment
variables for configuring log file rollovers.
Property | Description | Default |
---|---|---|
FILE_LOG_SIZE | The file size used to trigger the log file rollover. | 20 MB |
FILE_LOG_MAX | The maximum number of old archives. Once this value is reached, older archives are deleted upon later rollvers. | 10 |
The following is a configuration example:
cdr-kafka-router:
configuration:
env:
- name: FILE_LOG_SIZE
value: '1 MB'
- name: FILE_LOG_MAX
value: '10'
For more information about component log4j2 configuration, see the discussion about web app logging. For more information about using environment variables, see the discussion about environment variables and command arguments in MATRIXX Installation and Upgrade.