-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: how to save the file name with current date and time in log4
PostPosted: Tue Nov 21, 2006 2:55 am 
Newbie

Joined: Mon Sep 18, 2006 9:46 am
Posts: 13
Hi,


I am using lo4j.properties file.In this i have to save the file with current date and time with log extension. How tocan i do this.



Regards,
Ahamad


Top
 Profile  
 
 Post subject: save log file with current datetime in log4j.properties
PostPosted: Tue Nov 21, 2006 5:11 am 
Newbie

Joined: Mon Sep 18, 2006 9:46 am
Posts: 13
Hi,


log4j.appender.R.File=C:\\example.log


In the place of example i need to store current datetime in log4j.properties file


This is log4j.properties file


log4j.rootCategory=INFO, dest1
log4j.appender.dest1=org.apache.log4j.ConsoleAppender
log4j.appender.dest1.layout=org.apache.log4j.PatternLayout
log4j.appender.dest1.layout.ConversionPattern=%-5p: %m%n
log4j.rootLogger=INFO, R

#log4j.appender.stdout=org.apache.log4j.ConsoleAppender
#log4j.appender.stdout.layout=org.apache.log4j.PatternLayout

# Pattern to output the caller's file name and line number.
#log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n

log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=C:\\example.log

log4j.appender.R.MaxFileSize=100KB
# Keep one backup file
log4j.appender.R.MaxBackupIndex=1

log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%d{dd-MMM-yyyy hh:mm:ss} [%-5p] %c{1}.[%-5M] *** [%-10m]%


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.