Using MMS Logging
Logging Overview
This topic describes how to perform logging in TIBCO Streaming Model Management Server (MMS).
For all supported operating systems, MMS uses the industry-standard SLF4J logging system with the Logback framework.
You can configure the level of logging information emitted, and can direct logs to different appenders using standard Logback configuration files in XML format.
To configure a custom Logback configuration file, see Custom Configuration for Logback Logging below.
Logback Log Levels
MMS uses the standard log level meanings provided by the Logback framework, as defined in the Logger API.
Method | Notes |
---|---|
ERROR | An error caused by a resource problem (memory, disk, file descriptors, and so on), a corrupted product installation with missing required resources, host machine failures, or request error deemed significant. |
WARN | An operational error that impacts a specific operation, application performance, or availability of certain services. An operational error is caused by invalid parameters, temporary resource unavailability, or authentication and/or authorization failures. |
INFO | A normal status message for the life cycle, resource start-up information, and environment details such as library version numbers, class path contents, or location of configuration files. No action is required. |
DEBUG | Mid-level diagnostic debug messages. DEBUG messages should only be enabled on production systems at the request of TIBCO Technical Support. These messages are only of interest to the product development team. |
TRACE | Low-level diagnostic trace messages. TRACE messages should only be enabled on production systems at the request of TIBCO Technical Support. These messages are only of interest to the product development team. |
Log Files Generated
Log files are written by default into a subdirectory that is in the directory where the MMS server is installed. By default, the MMS server is installed in the user's home directory as specified in the following location:
- Linux/macOS:
$HOME/tibco/mms
- Windows:
%LOCALAPPDATA%\tibco\mms
Logback Default Configuration
MMS's default settings for Logback logging are as follows:
-
Two appenders are configured, the console appender and a file appender that writes to the
logs
subdirectory. -
Log messages from third-party libraries used in MMS are set to minimize their chattiness.
-
The default log level is INFO.
-
The default log message pattern is internally defined as:
%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level (%thread) %logger:%line %msg%n
-
One log file is written with the log file name
artifact-server.log
. -
Log file rollover is set to a maximum size of 10 MB for ten files.
The components of the default log message pattern have the meanings shown in the following table.
Message Pattern Component | Meaning |
---|---|
%d{yyyy-MM-dd HH:mm:ss.SSS} | Formatted timestamp. |
%thread | The name of the thread that generated the logging event. |
%-5level | The log level in five characters, left justified, with one or more padding spaces added on the right. |
%logger:%line | The qualified name of the class or component and the number from which the logging event was emitted |
%msg%n | Everything after the hyphen represents the text of the log message emitted by an instance of the Logger class in the code. %n represents the line-ending character or characters appropriate for the current operating system. |
Consult the Logback documentation for PatternLayout for the available log message pattern components.
You can override any of the default settings with a custom Logback configuration.
Custom Configuration for Logback Logging
To configure Logback logging, specify a Logback configuration file. MMS
accepts files in the traditional XML format, named logback.xml
. The
standard location of the logback.xml file is as given below:
- Linux/macOS:
$HOME/tibco/mms/conf
- Windows:
%LOCALAPPDATA%\tibco\mms\conf
The MMS server uses the first logback.xml
file in the classpath. A sample custom logback file is as shown below:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>logs/MMS-${HOSTNAME}.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
<fileNamePattern>logs/MMS-${HOSTNAME}.%i.log.zip</fileNamePattern>
<minIndex>1</minIndex>
<maxIndex>10</maxIndex>
</rollingPolicy>
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
<maxFileSize>10MB</maxFileSize>
</triggeringPolicy>
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>
<root level="INFO">
<appender-ref ref="CONSOLE" />
<appender-ref ref="FILE" />
</root>
<logger name="org.eclipse.jetty" level="WARN"/>
<logger name="org.hibernate" level="WARN"/>
<logger name="io.fabric8.kubernetes.client.Config" level="ERROR"/>
</configuration>
Docker Container Logging
You can enable Docker container logging by configuring a console
appender in a Docker-hosted MMS application (enabled by default). When
creating a Docker image using a Volume, the Volume path is prepended to
the Java classpath. You can place the logback.xml
file there as well.
For more information, see Docker Container Management.
Docker Logging from Command Line
Container logging is also available from the Docker command line using the logs command:
docker logs --follow <docker-container-name>
Docker Container Logging for Docker-based deployments:
The MMS logs are available through the console output. To configure logging, place the logback.xml file in the Docker source file directory.
For more information, see MMS Docker.
To view logs, use the following command:
docker logs --follow <container-name>
Logging and Monitoring for Kubernetes-based Deployments
Additional logging and Kubernetes cluster monitoring services are available when this deployment environment is used.
For more information, see Monitoring.