...
Info |
---|
Note: Utilities like logrotate for Linux (external link: https://linux.die.net/man/8/logrotate) also provide comparable functionality at operating system level. logrotate utility is not shipped with the tia Core cloud image and therefore not available forcloud deployment. |
Email notification
Info |
---|
tia Content Server 3.9.0 or higher is reuired for this funtionality |
The logging in tia ContentServer allows to send mails for errors. This requires an SMTP Server that will forward the mail to the recipient.
You need an additional appender for this (see also https://logback.qos.ch/manual/appenders.html#SMTPAppender) :
First create a logging.xml with an email appender:
Code Block | ||
---|---|---|
| ||
<configuration>
<property name="baseDir" value="logs" />
<property name="fileName" value="core-of-tia" />
<!--Activate this to log also in tomcat std out-->
<appender name="CONSOLE"
class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%32.32X{traceId}/%16.16X{spanId}] [%.-1p] [%20.20thread] %70.70(%30.30logger{10}.%M \(%4L\) ): %m%n</pattern>
</encoder>
</appender>
<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="INFO">
<appender-ref ref="emailAppender" />
<appender-ref ref="CONSOLE" />
</root>
</configuration> |
configure tia ContentServer to use logging.xml with the parameter:
logging.config