Rolling file appender in docker image

Mathew, Sunil smathew at hbs.edu
Fri Jan 13 08:11:37 UTC 2023


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/25e2ebba/attachment.htm>


More information about the users mailing list