how to create dynamic folders based on dates in log4j

ساخت وبلاگ

Vote count: 0

I want to create a folder dynamically for keep my logs on daily basis. For example in 'D:/AppLog/' folder there will be folder called '21-07-2016' which contains logs of particular date only. in the same folder there will be folder called '22-07-2016' which contains logs of particular date only

# Define the root logger with appender file
log4j.rootLogger = DEBUG, FILE
# Define the file appender
log4j.appender.FILE=org.apache.log4j.RollingFileAppender
# Set the name of the file
log4j.appender.FILE.File=D:/ClientLogs/client.log
# Set the immediate flush to true (default)
log4j.appender.FILE.ImmediateFlush=true
# Set the threshold to debug mode
log4j.appender.FILE.Threshold=debug
# Set the append to false, should not overwrite
log4j.appender.FILE.Append=true
# Set the maximum file size before rollover
log4j.appender.FILE.MaxFileSize=100KB
# Set the the backup index
log4j.appender.FILE.MaxBackupIndex=1000
# Define the layout for file appender
log4j.appender.FILE.layout=org.apache.log4j.PatteLayout
log4j.appender.FILE.layout.ConversionPatte=%d{dd MMM yyyy HH:mm:ss} %m%n
 That was my log4j.properties file. Please help me for this. Thank you 
asked 1 min ago

back soft...
ما را در سایت back soft دنبال می کنید

برچسب : نویسنده : استخدام کار backsoft بازدید : 362 تاريخ : پنجشنبه 31 تير 1395 ساعت: 12:55