Example: Logging configuration for Email notification
tia Content Server 3.9.0 or higher is required for this functionality.
This article gives an example log configuration file and explains it roughly.
To activate this file, copy it to the directory containing all other configurations for tia Content Server Core and set the parameter logging.config
with path and file name of this file.
Logging configuration for Email notification
This example demonstrates how to set up tia Content Server send log file information as email notification.
The example only includes the email notification log appender. Like this, tia Content Server Core wouldn’t log anywhere else.
So, combine this email appender with logging to standard out or to file.
The emailAppender
appender (line 3 to 14) defines
smtpHost
andsmtpPort
: The SMTP server to send this mailto
: The addressee of the email notificationfrom
: The sender address of the email notificationsubject
: The subject of the emaillayout
: the (enriched) format of the application log output is specified (line 11 to 13).
The default log file pattern is explained in this knowledge base article: https://kgs-software.atlassian.net/wiki/spaces/SUPPORT/pages/3661987841
The root
tag is the main point to load these specifications. Here,
the default root log level is set, as well as
the appender bound for logging.
Example logging configuration file
<configuration>
<appender name="emailAppender" class="ch.qos.logback.classic.net.SMTPAppender">
<smtpHost><yourSMTPHost></smtpHost>
<smtpPort><yourSMTPPort></smtpPort>
<!-- one or more recipients are possible -->
<to>test@test.de</to>
<from>errorlog@test.de</from>
<subject>Error occured: %logger{20} - %msg</subject>
<layout class="ch.qos.logback.classic.PatternLayout">
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{35} - %msg%n</pattern>
</layout>
</appender>
<root level="ERROR">
<appender-ref ref="emailAppender"/>
</root>
</configuration>