You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "Ralph Goers (Jira)" <ji...@apache.org> on 2022/06/24 07:30:00 UTC

[jira] [Commented] (LOG4J2-3544) SizeBasedTriggeringPolicy is not working properly for log4j.xml

    [ https://issues.apache.org/jira/browse/LOG4J2-3544?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17558367#comment-17558367 ] 

Ralph Goers commented on LOG4J2-3544:
-------------------------------------

# You have a bunch of variables - $LOG_PATTERN{, ${BOOTSTRAPLOG}, and ${CSVFILE} - that aren't defined anywhere. How can this work?
# You specify %d{yyyy-MM-dd} in a pattern that doesn't use a time based triggering policy. You really should use ${date} instead.
# Please try with the current snapshot from the release-2.x branch.
# If after changing the above it isn't working please change status="WARN" to status="DEBUG" and provide the resulting log entries.

> SizeBasedTriggeringPolicy is not working properly for log4j.xml 
> ----------------------------------------------------------------
>
>                 Key: LOG4J2-3544
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-3544
>             Project: Log4j 2
>          Issue Type: Bug
>    Affects Versions: 2.17.1
>            Reporter: Netshia Rendani
>            Priority: Major
>             Fix For: 2.17.1
>
>
> I have being try to get configuration for my Java App that have two different file to where one is for and  Core BootStrap Log files and also App log file which is responsable for logging all the app logs but it is not working for Core BootStrap Log files but only working for the app log file. the Core BootStrap Log files  keeps one logging the SizeBasedTriggeringPolicy it not working for this implementation. 
>  
> <?xml version="1.0" encoding="UTF-8"?>
> <Configuration status="WARN">
>     <Properties>
>         <Property name="LOG_FOLDER">c:/logs</Property>
>         <Property name="COREBOOTSTRAPLOG">./log/corelogs.log</Property>
>         <Property name="APPLOGS">./log/applogs.log</Property>
>     </Properties>
>     <Appenders>
>         <Console name="LogToConsole" target="SYSTEM_OUT">
>             <PatternLayout
>                 pattern='%d\{HH:mm:ss.SSS} [%t] %-5level %logger\{36} - %msg%n' />
>         </Console>
>         <RollingFile name="CoreBootStrapLogFile"
>             fileName='${COREBOOTSTRAPLOG}'
>             filePattern='${COREBOOTSTRAPLOG}.%d\{yyyy-MM-dd}.%i'>
>             <PatternLayout>
>                 <Pattern>${LOG_PATTERN}</Pattern>
>             </PatternLayout>            
>             <Policies>
>                 <SizeBasedTriggeringPolicy size="500KB" />
>             </Policies>
>             <DefaultRolloverStrategy max="10"/> 
>         </RollingFile>
>     
>         <RollingFile name="ApplogsFile"
>             fileName='${LOG_FOLDER}/${BOOTSTRAPLOG}'
>             filePattern='${CSVFILE}.%d\{yyyy-MM-dd}'>
>             <PatternLayout>
>                 <Pattern>${LOG_PATTERN}</Pattern>
>             </PatternLayout>
>             <Policies>
>                     <TimeBasedTriggeringPolicy interval="1" modulate="true" />
>                     <SizeBasedTriggeringPolicy size="50MB" />
>             </Policies>
>         </RollingFile>
>         
>     
>         
>     </Appenders>
>     <Loggers>
>         <!-- avoid duplicated logs with additivity=false -->
>         
>         <Logger name="com.spacework.application.configs.SpaceBootStrapApp" 
>             level="debug" additivity="false">
>             <AppenderRef ref="CoreBootStrapLogFile" />
>         </Logger>
>         
>         <Logger name="com.spacework.application.SpaceLoaderApp" 
>             level="debug" additivity="false">
>             <AppenderRef ref="ApplogsFile" />
>         </Logger>
>         <Root >
>             <AppenderRef ref="CoreBootStrapLogFile" level="info"/> 
>             <AppenderRef ref="ApplogsFile" level="info"/>
>         
>         </Root>
>     </Loggers>
> </Configuration>



--
This message was sent by Atlassian Jira
(v8.20.7#820007)