logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kamal Mettananda (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (LOG4J2-1224) Log4j2 Rolling file appender not working
Date Fri, 29 Apr 2016 09:28:12 GMT

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

Kamal Mettananda commented on LOG4J2-1224:
------------------------------------------

Hi

I tested this configuration file and it is correctly working.

However, the log file and the archived files are generated in two locations as per the config.

{code:xml}
<RollingFile name="Test"
                fileName="/tmp/Test.log" 
                filePattern="logs/$${date:yyyy-MM}/app-%d{yyyy-MM-dd-HH-mm}-%i.log.gz" >
{code}

h3. Log file location
{noformat}/tmp/Test.log{noformat}

h3. Archived file location
{noformat}<Location-where-you-are>/logs/<DATE>/app-<DATE>-i.log.gz{noformat}

Can you check these locations and verify the archive files are generated correctly?

Thanks

> Log4j2 Rolling file appender not working
> ----------------------------------------
>
>                 Key: LOG4J2-1224
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-1224
>             Project: Log4j 2
>          Issue Type: Question
>          Components: Appenders
>    Affects Versions: 2.5
>            Reporter: Kiran Kumar Vadla
>            Priority: Minor
>
> Hi , 
> I am using log4j 2.5 and using rolling file appender . Following is the configuration
of log4j.xml . Just to test I have kept the size as 1 KB . But the file is not rolling after
the size has reached to 1 KB . 
> <?xml version="1.0" encoding="UTF-8"?>
> <Configuration>
>   	
>   <Appenders>
>   	 <RollingFile name="Test" fileName="/tmp/Test.log"
>                  filePattern="logs/$${date:yyyy-MM}/app-%d{yyyy-MM-dd-HH-mm}-%i.log.gz">
>       <PatternLayout>
>         <Pattern>%d|%m%n</Pattern>
>       </PatternLayout>
>       <Policies>
>         <TimeBasedTriggeringPolicy interval="1" modulate="true"/>
>         <SizeBasedTriggeringPolicy size="1 KB"/>
>       </Policies>
>     </RollingFile>
>   </Appenders>
>   <Loggers>
>   	<Root level="INFO">
>     	<AppenderRef ref="Test"/>
>     </Root>
>   </Loggers>
> </Configuration>



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


Mime
View raw message