/
Example: Logging configuration for Email notification

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 and smtpPort: The SMTP server to send this mail

  • to: The addressee of the email notification

  • from: The sender address of the email notification

  • subject: The subject of the email

  • layout: 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>

 

Related content

Example: Logging configuration for JSON logging
Example: Logging configuration for JSON logging
More like this
Example: Logging configuration to standard out
Example: Logging configuration to standard out
More like this
Configuration of logging framework in WAR file deployments.
Configuration of logging framework in WAR file deployments.
More like this
Example: Logging configuration for rolling log file
Example: Logging configuration for rolling log file
More like this
Configuration of logging framework in container deployment
Configuration of logging framework in container deployment
More like this
Logging for tia® server components
Logging for tia® server components
More like this