logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "sivan (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (LOG4J2-610) Rolling file appender
Date Tue, 22 Apr 2014 08:11:15 GMT

     [ https://issues.apache.org/jira/browse/LOG4J2-610?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

sivan updated LOG4J2-610:
-------------------------

    Description: 
Rolling file appender creates a new log file with contents from old file also. The requirement
is to create new files on daily basis. Is this is related with application restart.? This
is happening in UAT and the application has been restarted two times.

My configuration is as follows. Can you please help me to resolve this issue.

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
	<properties>
		<property name="patternUMP">log_type_%c|%K{sessionId}|%t|%d{MM/dd/yyyy HH:mm:ss.SSS}|%p|%C|%M|%L|%K{msg}%n</property>
		<property name="filePattern">${sys:logfilepath}//$${date:yyyy-MM}//${sys:oft.appserver}-out-%d{yyyy-MM-dd}.log</property>
		<property name="fileName">${sys:logfilepath}//${sys:oft.appserver}-out.log</property>
	</properties>
	<appenders>
		<Console name="Console" target="SYSTEM_OUT">
			<PatternLayout pattern="${patternUMP}"/>
		</Console>
		<RollingFile name="rfaUMP" fileName="${fileName}" filePattern="${filePattern}">
			<PatternLayout>
				<pattern>${patternUMP}</pattern>
			</PatternLayout>
			<Policies>
				<TimeBasedTriggeringPolicy />
				<SizeBasedTriggeringPolicy />
			</Policies>
			<DefaultRolloverStrategy compressionLevel="0" max="3"/>
		</RollingFile>	
		<Async name="AsyncAppender" includeLocation="true">
      		<AppenderRef ref="rfaUMP"/>
    	</Async>	
	</appenders>
	<loggers>					
		<AsyncLogger name="sso" level="info" includeLocation="true">
			<AppenderRef ref="AsyncAppender"/>
		</AsyncLogger>
		<AsyncLogger name="webservice" level="info" includeLocation="true">
			<AppenderRef ref="AsyncAppender"/>
		</AsyncLogger>
		<Logger name="Console" level="info">
            <AppenderRef ref="Console"/>
        </Logger>
		<root level="debug">
			<AppenderRef ref="Console"/>
		</root>
	</loggers>
</configuration>



  was:
Rolling file appender creates a new log file with contents from old file also. I want to create
new files on daily basis. My configuration is as follows. Can you please help me to resolve
this issue.
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
	<properties>
		<property name="patternUMP">log_type_%c|%K{sessionId}|%t|%d{MM/dd/yyyy HH:mm:ss.SSS}|%p|%C|%M|%L|%K{msg}%n</property>
		<property name="filePattern">${sys:logfilepath}//$${date:yyyy-MM}//${sys:oft.appserver}-out-%d{yyyy-MM-dd}.log</property>
		<property name="fileName">${sys:logfilepath}//${sys:oft.appserver}-out.log</property>
	</properties>
	<appenders>
		<Console name="Console" target="SYSTEM_OUT">
			<PatternLayout pattern="${patternUMP}"/>
		</Console>
		<RollingFile name="rfaUMP" fileName="${fileName}" filePattern="${filePattern}">
			<PatternLayout>
				<pattern>${patternUMP}</pattern>
			</PatternLayout>
			<Policies>
				<TimeBasedTriggeringPolicy />
				<SizeBasedTriggeringPolicy />
			</Policies>
			<DefaultRolloverStrategy compressionLevel="0" max="3"/>
		</RollingFile>	
		<Async name="AsyncAppender" includeLocation="true">
      		<AppenderRef ref="rfaUMP"/>
    	</Async>	
	</appenders>
	<loggers>					
		<AsyncLogger name="sso" level="info" includeLocation="true">
			<AppenderRef ref="AsyncAppender"/>
		</AsyncLogger>
		<AsyncLogger name="webservice" level="info" includeLocation="true">
			<AppenderRef ref="AsyncAppender"/>
		</AsyncLogger>
		<Logger name="Console" level="info">
            <AppenderRef ref="Console"/>
        </Logger>
		<root level="debug">
			<AppenderRef ref="Console"/>
		</root>
	</loggers>
</configuration>




> Rolling file appender
> ---------------------
>
>                 Key: LOG4J2-610
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-610
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: Appenders
>    Affects Versions: 2.0-rc1
>         Environment: Java
>            Reporter: sivan
>
> Rolling file appender creates a new log file with contents from old file also. The requirement
is to create new files on daily basis. Is this is related with application restart.? This
is happening in UAT and the application has been restarted two times.
> My configuration is as follows. Can you please help me to resolve this issue.
> <?xml version="1.0" encoding="UTF-8"?>
> <configuration>
> 	<properties>
> 		<property name="patternUMP">log_type_%c|%K{sessionId}|%t|%d{MM/dd/yyyy HH:mm:ss.SSS}|%p|%C|%M|%L|%K{msg}%n</property>
> 		<property name="filePattern">${sys:logfilepath}//$${date:yyyy-MM}//${sys:oft.appserver}-out-%d{yyyy-MM-dd}.log</property>
> 		<property name="fileName">${sys:logfilepath}//${sys:oft.appserver}-out.log</property>
> 	</properties>
> 	<appenders>
> 		<Console name="Console" target="SYSTEM_OUT">
> 			<PatternLayout pattern="${patternUMP}"/>
> 		</Console>
> 		<RollingFile name="rfaUMP" fileName="${fileName}" filePattern="${filePattern}">
> 			<PatternLayout>
> 				<pattern>${patternUMP}</pattern>
> 			</PatternLayout>
> 			<Policies>
> 				<TimeBasedTriggeringPolicy />
> 				<SizeBasedTriggeringPolicy />
> 			</Policies>
> 			<DefaultRolloverStrategy compressionLevel="0" max="3"/>
> 		</RollingFile>	
> 		<Async name="AsyncAppender" includeLocation="true">
>       		<AppenderRef ref="rfaUMP"/>
>     	</Async>	
> 	</appenders>
> 	<loggers>					
> 		<AsyncLogger name="sso" level="info" includeLocation="true">
> 			<AppenderRef ref="AsyncAppender"/>
> 		</AsyncLogger>
> 		<AsyncLogger name="webservice" level="info" includeLocation="true">
> 			<AppenderRef ref="AsyncAppender"/>
> 		</AsyncLogger>
> 		<Logger name="Console" level="info">
>             <AppenderRef ref="Console"/>
>         </Logger>
> 		<root level="debug">
> 			<AppenderRef ref="Console"/>
> 		</root>
> 	</loggers>
> </configuration>



--
This message was sent by Atlassian JIRA
(v6.2#6252)

---------------------------------------------------------------------
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