[
https://issues.apache.org/jira/browse/LOG4J2-2137?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16776030#comment-16776030
]
Philip edited comment on LOG4J2-2137 at 2/23/19 9:03 PM:
---------------------------------------------------------
I did, and like I said, I don't get a log file at all when I use
DefaultRolloverStrategy, even with status="DEBUG"
<?xml version="1.0" encoding="UTF-8" ?>
<Configuration status="DEBUG">
<Properties>
<Property name="basePath">D:\\logs</Property>
</Properties>
<Appenders>
<RollingFile name="fileLogger"
filePattern="${basePath}/%d\{yyyy-MM-dd-HH-mm-ss}.log">
<PatternLayout>
<pattern>[%level] [%d\{HH:mm:ss.SSS}] [%c\{1}] %msg%n</pattern>
</PatternLayout>
<Policies>
<SizeBasedTriggeringPolicy size="1 KB"/>
</Policies>
<DefaultRolloverStrategy max="2"/>
</RollingFile>
<Console name="Console" target="SYSTEM_OUT">
<PatternLayout pattern="%d\{HH:mm:ss.SSS} [%t] %-5level %logger\{36} - %msg%n"
/>
</Console>
</Appenders>
<Loggers>
<Root level="trace">
<AppenderRef ref="Console" />
<AppenderRef ref="fileLogger" />
</Root>
</Loggers>
</Configuration>
was (Author: confrizz):
I did, and like I said, I don't get a log file at all when I use
DefaultRolloverStrategy, even with status="DEBUG"
> SizeBasedTriggeringPolicy with DefaultRolloverStrategy is not working
> ---------------------------------------------------------------------
>
> Key: LOG4J2-2137
> URL: https://issues.apache.org/jira/browse/LOG4J2-2137
> Project: Log4j 2
> Issue Type: Bug
> Components: Appenders
> Affects Versions: 2.3
> Environment: Linux
> IBM J9 VM (build 2.4, J2RE 1.6.0 IBM J9 2.4 Linux x86-32
> jvmxi3260-20080816_22093 (JIT enabled, AOT enabled)
> Reporter: Ajay Pachlangia
> Priority: Major
> Labels: features
> Fix For: 2.3
>
>
> Hi Team,
> I have used below given log4j file and expect my logs to be getting generated
> up to size 1 MB with limit of 5 files but files are not reaching to the max
> size and next files getting started written.
> 1048596 Dec 1 18:31 A-2017-12-01-3.log
> 449246 Dec 1 18:33 A-2017-12-01-1.log
> 1048636 Dec 1 18:32 A-2017-12-01-2.log
> 123424 Dec 1 18:33 A-2017-12-01-5.log
> 565972 Dec 1 18:33 A-2017-12-01-4.log
> 270800 Dec 1 18:33 A.log
> ---Log4j used ----
> <?xml version="1.0" encoding="UTF-8"?>
> <Configuration monitorInterval="5">
> <Appenders>
> <RollingFile name="Online" fileName="My_Logs_Path/A.log" append="true"
> immediateFlush="true" bufferedIO="false"
> filePattern="My_Logs_Path/A-%d{yyyy-MM-dd}-%i.log">
> <PatternLayout>
>
> <pattern>|%-5p|%d{yyyy-MM-dd|HH:mm:ss,SSS}|%X{InterfaceId}|%X{SeqNo}|%X{Ouid}
> %X{srch1}
> %X{BussRef}|${sys:hostname}|${sys:ApplicationComponent}|%X{ExternalRefSend}|%m||%C{6}:%L|%t%n</pattern>
> </PatternLayout>
> <Policies>
> <SizeBasedTriggeringPolicy size="1 MB" />
> </Policies>
> <DefaultRolloverStrategy max="5"/>
> <Filters>
> <ThresholdFilter level="FATAL" onMatch="ACCEPT"
> onMismatch="NEUTRAL"/>
> <ThresholdFilter level="ERROR" onMatch="ACCEPT"
> onMismatch="NEUTRAL"/>
> <ThresholdFilter level="WARN" onMatch="ACCEPT"
> onMismatch="NEUTRAL"/>
> <ThresholdFilter level="INFO" onMatch="ACCEPT"
> onMismatch="NEUTRAL"/>
> <ThresholdFilter level="DEBUG" onMatch="ACCEPT"
> onMismatch="NEUTRAL"/>
> </Filters>
> </RollingFile>
>
> <RollingFile name="abcd"
> fileName="My_Logs_Path/B.log" append="true" immediateFlush="true"
> bufferedIO="false" filePattern="My_Logs_Path/B-%d{yyyy-MM-dd}-%i.log">
> <PatternLayout>
>
> <pattern>|%-5p|%d{yyyy-MM-dd|HH:mm:ss,SSS}|%X{InterfaceId}|%X{SeqNo}|%X{Ouid}
> %X{srch1}
> %X{BussRef}|${sys:hostname}|${sys:ApplicationComponent}|%X{ExternalRefSend}|%m||%C{6}:%L|%t%n</pattern>
> </PatternLayout>
> <Policies>
> <SizeBasedTriggeringPolicy size="1 MB" />
> </Policies>
> <DefaultRolloverStrategy max="5"/>
> <Filters>
> <ThresholdFilter level="FATAL" onMatch="ACCEPT"
> onMismatch="NEUTRAL"/>
> <ThresholdFilter level="ERROR" onMatch="ACCEPT"
> onMismatch="NEUTRAL"/>
> <ThresholdFilter level="WARN" onMatch="ACCEPT"
> onMismatch="NEUTRAL"/>
> <ThresholdFilter level="INFO" onMatch="ACCEPT"
> onMismatch="NEUTRAL"/>
> <ThresholdFilter level="DEBUG" onMatch="ACCEPT"
> onMismatch="NEUTRAL"/>
> </Filters>
> </RollingFile>
> <RollingFile name="efgh" fileName="My_Logs_Path/C.log" append="true"
> immediateFlush="true" bufferedIO="false"
> filePattern="My_Logs_Path/C-%d{yyyy-MM-dd}-%i.log">
> <PatternLayout>
>
> <pattern>|%-5p|%d{yyyy-MM-dd|HH:mm:ss,SSS}|%X{InterfaceId}|%X{SeqNo}|%X{Ouid}
> %X{srch1}
> %X{BussRef}|${sys:hostname}|${sys:ApplicationComponent}|%X{ExternalRefSend}|%m||%C{6}:%L|%t%n</pattern>
> </PatternLayout>
> <Policies>
> <SizeBasedTriggeringPolicy size="1 MB" />
> </Policies>
> <DefaultRolloverStrategy max="5"/>
> <Filters>
> <ThresholdFilter level="FATAL" onMatch="ACCEPT"
> onMismatch="NEUTRAL"/>
> <ThresholdFilter level="ERROR" onMatch="ACCEPT"
> onMismatch="NEUTRAL"/>
> <ThresholdFilter level="WARN" onMatch="ACCEPT"
> onMismatch="NEUTRAL"/>
> <ThresholdFilter level="INFO" onMatch="ACCEPT"
> onMismatch="NEUTRAL"/>
> <ThresholdFilter level="DEBUG" onMatch="ACCEPT"
> onMismatch="NEUTRAL"/>
> </Filters>
> </RollingFile>
>
> <RollingFile name="CHANNEL_STATUS"
> fileName="My_Logs_Path/D.log" append="true" immediateFlush="true"
> bufferedIO="false" filePattern="My_Logs_Path/D-%d{yyyy-MM-dd}-%i.log">
> <PatternLayout>
>
> <pattern>|%-5p|%d{yyyy-MM-dd|HH:mm:ss,SSS}|${sys:hostname}|${sys:ApplicationComponent}|%m||%C{6}:%L|%t%n</pattern>
> </PatternLayout>
> <Policies>
> <SizeBasedTriggeringPolicy size="1 MB" />
> </Policies>
> <DefaultRolloverStrategy max="5"/>
> </RollingFile>
> </Appenders>
> <loggers>
> <logger name="TTTT" level="DEBUG">
> <appender-ref ref="Online" level="DEBUG"/>
> </logger>
> <logger name="AAAA" level="DEBUG">
> <appender-ref ref="abcd" level="DEBUG"/>
> </logger>
> <logger name="BBBB" level="DEBUG" additivity="false">
> <appender-ref ref="efgh"/>
> </logger>
> <logger name="CHANNEL_LOGGER" level="DEBUG" additivity="false">
> <appender-ref ref="CHANNEL_STATUS" level="DEBUG"/>
> </logger>
> <logger name="org.springframework" level="OFF">
> </logger>
> </loggers>
> </Configuration>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)