Using AMS Logging


Table of Contents
Logging Overview
Logback Log Levels
Log Files Generated
Logback Default Configuration
Custom Configuration for Logback Logging
Docker Container Logging

Logging Overview

This topic describes how perform logging in AMS.

For all supported operating systems, AMS 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 files see Custom Configurationbelow.

Logback Log Levels

StreamBase uses the standard log level meanings provided by the Logback framework, as defined in the Logger API.

MethodNotes
ERRORAn 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.
WARNAn 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.
INFOA 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.
DEBUGMid-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.
TRACELow-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 named logs under the directory where the ams-server command was executed. You can change the location and name of the logs directory by editing the logback.xml file.

Logback Default Configuration

AMS'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 AMS 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 AMS-${HOSTNAME}.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 ComponentMeaning
%d{yyyy-MM-dd HH:mm:ss.SSS}Formatted timestamp.
%threadThe name of the thread that generated the logging event.
%-5levelThe log level in five characters, left-justified, with one or more padding spaces added on the right.
%logger:%lineThe qualified name of the class or component and number from which the logging event was emitted
%msg%nEverything after the hyphen represents the text of the log message emitted by an instance of the Logger class in 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. AMS accepts files in the traditional XML format, named logback.xml. The standard location of the logback.xml file is in the ams/conf directory, but can be placed anywhere is the Java classpath. The AMS server uses the first logback.xml file in the classpath.

Docker Container Logging

You can enable Docker container logging by configuring a console appender in a Docker-hosted AMS 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. See the README.txt in the ams/docker-image directory of the AMS installation for more details.

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>