Rolling file appender in docker image
Paul Caskey
pcaskey at internet2.edu
Fri Jan 13 12:49:37 UTC 2023
This is because the logfile inside the container should not contain any actual log messages. There is a pipe created at run-time that redirects log messages to stdout to be handled by docker, which is pretty standard practice.
From: users <users-bounces at shibboleth.net> On Behalf Of Mathew, Sunil via users
Sent: Friday, January 13, 2023 2:12 AM
To: Users at shibboleth.net
Cc: Mathew, Sunil <smathew at hbs.edu>
Subject: Rolling file appender in docker image
Hi,
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?
Here is the logback.xml in docker image:
<!-- Process log. -->
<appender name="IDP_PROCESS" class="ch.qos.logback.core.FileAppender">
<File>/tmp/logidp-process</File>
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<charset>UTF-8</charset>
<Pattern>%date{ISO8601} - %mdc{idp.remote_addr} - %level [%logger:%line] - %msg%n%ex{short}</Pattern>
</encoder>
<!-- Ignore Velocity status page error. -->
<filter class="ch.qos.logback.core.filter.EvaluatorFilter">
<evaluator>
<matcher>
<Name>VelocityStatusMatcher</Name>
<regex>ResourceManager\s*: unable to find resource 'status\.vm' in any resource loader\.</regex>
</matcher>
<expression>VelocityStatusMatcher.matches(formattedMessage)</expression>
</evaluator>
<OnMatch>DENY</OnMatch>
</filter>
</appender>
Here is the logback.xml in Shibboleth install:
<!-- Process log. -->
<appender name="IDP_PROCESS" class="ch.qos.logback.core.rolling.RollingFileAppender">
<File>${idp.logfiles}/idp-process.log</File>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${idp.logfiles}/idp-process-%d{yyyy-MM-dd}.log.gz</fileNamePattern>
<maxHistory>${idp.loghistory}</maxHistory>
</rollingPolicy>
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<charset>UTF-8</charset>
<Pattern>%date{ISO8601} - %mdc{idp.remote_addr} - %level [%logger:%line] - %msg%n%ex{short}</Pattern>
</encoder>
<!-- Ignore Velocity status page error. -->
<filter class="ch.qos.logback.core.filter.EvaluatorFilter">
<evaluator>
<matcher>
<Name>VelocityStatusMatcher</Name>
<regex>ResourceManager\s*: unable to find resource 'status\.vm' in any resource loader\.</regex>
</matcher>
<expression>VelocityStatusMatcher.matches(formattedMessage)</expression>
</evaluator>
<OnMatch>DENY</OnMatch>
</filter>
</appender>
Regards,
Sunil
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://shibboleth.net/pipermail/users/attachments/20230113/e3598139/attachment.htm>
More information about the users
mailing list