Default configuration
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/
It is best practice for modifications to Log4J2 configuration 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.
The required logging parameters are:default logging targets are:
container-deployment:
SYSTEM_OUT
war-deployment:
core-of-tia.log
file in<web application server>/WEB-INF/<web context>/logs
directory.
When using container-deployment, it can be required to write logging information to SYSTEM_OUT
. There it may be read from other tools.
Logs written to stdout
or stderr
may also be viewed by docker
command (when 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.
Using war-deployment, log rotation is activated by default:
tia Core writes the log file
core-of-tia.log
into the logs sub directory of the web context 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.
Custom configuration
When requiring custom configuration file, create the logging configuration file and point tia Core to it using the logging.config
parameter.
Control the log level overall by parameter logging.level.root
, respective at package granularity by parameter logging.level.<package>
.
Parameter | Description | Supported Values | Required | Default value |
| Log Level for all logging. If special log level for package is configured, package configuration will overrule. Recommended for Production is WARN or ERROR. |
| no | DEBUG |
Examples:
| Definition of the log level for the package.
|
| no |
|
| Specifies a location for the configuration file of the logging framework |
<tomcat installation directory>/bin
).
| Path and filename | no |
|
For more information how to apply these parameters, please read Application wide settings.
Info |
---|
Note: For the configuration file itself applies the syntax of the logging framework, which ich SLFJ4-compliant (external link: https://www.slf4j.org/manual.html).
|
Log rotation
In production systems, log files can grow large over time and consume disc space as well. Also handling of large log files for issue analysis is getting more difficult. Log rotation refers to an automatic set up to periodically or on trigger event (like log file exceeds a specified size) copy log files aside and keep only a certain number of copies.
Log rotation can be configured by Log4J2 an appender .
By default, tia Core implements log rotation using Log4Js RollingFileAppender (see file <webapp>\WEB-INF\classes\log4j2.xml
) like this:
...
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
.
...
in the logging configuration file. The logging framework provideds the RollingFileAppender (external Log4J link: https://logging.apache.org/log4j/2.x/manual/appenders.html#rollingfileappender, external Logback link: https://logback.qos.ch/manual/appenders.html#RollingFileAppender).
Info |
---|
Note: Utilities like logrotate for Linux (external link: https://linux.die.net/man/8/logrotate) also provide similiar comparable functionality on at operating system level. logrotate utility is not shipped with the tia Core cloud image and therefore not available forcloud deployment. |