Netshia Rendani created LOG4J2-3544:
---------------------------------------
Summary: 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
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="DynabobLogFile" level="info"/>
<AppenderRef ref="ApplogsFile" level="info"/>
</Root>
</Loggers>
</Configuration>
--
This message was sent by Atlassian Jira
(v8.20.7#820007)