Rolling file appender in docker image
Mathew, Sunil
smathew at hbs.edu
Fri Jan 13 14:32:06 UTC 2023
Thanks everyone. I am logging to console, which gets to Cloud Watch and Splunk through Firehose. Logging to file helps with the debugging.
Sunil
From: users <users-bounces at shibboleth.net> on behalf of Daniel Lutz via users <users at shibboleth.net>
Date: Friday, January 13, 2023 at 8:51 AM
To: users at shibboleth.net <users at shibboleth.net>
Cc: Daniel Lutz <daniel.lutz at switch.ch>
Subject: Re: Rolling file appender in docker image
Mathew, Sunil via users schrieb/wrote (13.01.23 09:11):
> I am writing logs to log file in the docker image. The issue is that the logback.xml
> in the docker image has FileAppender instead of RollingFileAppender (as is in the standard
> Shibboleth install) and so the file is growing in size inside the docker container without
> rolling over. Is there a reason why the docker image logback.xml is not using RollingFileAppender?
You should log everything to the container's stdout instead.
We use the following Logback configuration in our containers to log everything to the console (i.e. stdout).
With this configuration, the IdP's logs are available via the container's logs (e.g. "docker logs <container>").
(We start the containers with the "journald" log driver, such that all logs from the container
are sent to the host's jornald.)
/opt/shibboleth-idp/conf/logback.xml:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
...
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<charset>UTF-8</charset>
<Pattern>%date{yyyy-MM-dd HH:mm:ss.SSS} [%5level] : %logger: %msg%n</Pattern>
</encoder>
<!-- or to log in JSON format -->
<!--
<encoder class="net.logstash.logback.encoder.LogstashEncoder">
<timeZone>UTC</timeZone>
</encoder>
-->
</appender>
<logger name="Shibboleth-Audit" level="ALL">
<appender-ref ref="${idp.audit.appender:-CONSOLE}"/>
</logger>
<logger name="Shibboleth-FTICKS" level="ALL" additivity="false">
<appender-ref ref="${idp.fticks.appender:-CONSOLE}"/>
</logger>
<logger name="Shibboleth-Consent-Audit" level="ALL">
<appender-ref ref="${idp.consent.appender:-CONSOLE}"/>
</logger>
<root level="${idp.loglevel.root:-INFO}">
<appender-ref ref="${idp.process.appender:-CONSOLE}"/>
<appender-ref ref="${idp.warn.appender:-CONSOLE}" />
</root>
</configuration>
(You need to ensure that the "idp.*.appender" properties are not set
or set to "CONSOLE".)
Daniel
--
For Consortium Member technical support, see https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fshibboleth.atlassian.net%2Fwiki%2Fx%2FZYEpPw&data=05%7C01%7Csmathew%40hbs.edu%7Cf9c2eab40509492344dd08daf56d07be%7C09fd564ebf4243218f2db8e482f8635c%7C0%7C0%7C638092146758792881%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=%2BQwQOUx%2F1JCXxOIOranz3dPTwMHN2okD4HRiwYxIUtY%3D&reserved=0
To unsubscribe from this list send an email to users-unsubscribe at shibboleth.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://shibboleth.net/pipermail/users/attachments/20230113/ba7edf71/attachment.htm>
More information about the users
mailing list