Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

tia Core uses Log4J2 Framework for logging. So the general documentation of this framework applies.

External link to the Apache Log4J project web page: https://logging.apache.org/log4j/2.x/

 

Log rotation can be configured by Log4J2 appender or on Linux using utilities like logrotate (external link: https://linux.die.net/man/8/logrotate). logrotate utility is not shipped with the tia Core cloud image and therefore not available for cloud deployment.

By default, tia Core implements log rotation using Log4Js RollingFileAppender (see file <webapp>\WEB-INF\classes\log4j2.xml):

·        tia Core writes the log file core-of-tia.log in the logs sub directory of the web application base directory.

·        At 0:00am and in case the log file exceeds 1GB, it is gz-compressed and renamed to core-of-tia-<n>.log.gz.

·        Up to 10 compressed log files will be kept before removal.

 

Use Spring Boot 2 configuration to specify the location of a custom log4j2.xml file and to specify log level for specific components overruling the default settings in the file.

 

Best practice for modifications to Log4J2 configuration is to copy existing log4j2-spring.xml file to a custom version (e.g. my.log4j2.xml) that then is modified and linked in by setting logging.conf parameter (see below).

 

tia Core builds also on top of Spring Boot 2 framework, so that at start of the system the configuration is applied via this framework.

External link to the Spring Framework web page: https://spring.io/projects/spring-boot

The parameters required are:

...

Key

...

Description

...

Supported Values

...

Required

...

Info

This article focuses on container-deployment of tia® Core products.

 

By default, tia® Core logs to Standard out.

There it may be read by observability tools.

Info

Hint: Logs written to stdout or stderr may also be viewed by docker command (if using another container runtime, please refer to its documentation):

  • Code Block
    docker container logs <container name or id>

Using this command with option -f allows to watch log file tail continuously.

Custom configuration

The log level can be configured for the complete product (parameter logging.level.root), or for a special module only (parameter logging.level.<package>).

The log row format, the log location, and other can be configured in a log configuration file (the default file shipped with the product is logback-spring.xml). It is recommended to create a new logging configuration file. Use parameter logging.config to point to the custom configuration file.

Info

The logging framework included in tia® Content Server Core is SLFJ4-compliant. For documentation refer to the https://www.slf4j.org/manual.html. Since tia® Content Server Core Release 3.0.0 this is Logback framework (see https://logback.qos.ch/).

tia® Content Server Core parameters for logging:

Parameter

Description

Supported Values

Required

Default value

logging.level.root

Log Level for all logging.

If log level for package is configured, package configuration will overrule.

Recommended for Production is WARN or ERROR.

OFF

ERROR

WARN

INFO

DEBUG

no

DEBUG

logging.level.<package>

Example:

logging.level.com.software.kgs

Definition of the log level for the package.

 

OFF

;

ERROR

;

WARN

;

INFO

;

DEBUG

no

n

 

logging.config

Specifies a location for the

log4j2.xml to be used instead

configuration file of the

default

A path specified absolute or relative to the working directory of tomcat service, e.g. <tomcat installation directory>/bin.

n

 

How exactly to specify these parameters depends on the deployment option selected.

Note: kgs recommends to stick with the described best practice configuration described in the subchapters to this topic. It is possible that more advanced configuration may lead to system behavior that is hard to analyze.

...

logging framework.

Info

Hint: When using container-deployment volume mapping maybe required.

Path and filename

no

logback-spring.xml

For more information how to apply these parameters, please read Application wide settings.

For example logging configuration files see: