Hi,
1)
In my web-based application i am using log4j for debugging my application.But the problem i m facing is that whenever i have to delete the logs generated while the Tomcat Server is on that is i am testing my application, i am able to delete the logs but not able to save the file so all the logs i deleted diplays again plus the new one generated.The system
says the file is in use?? So i have to shutdown my tomcat & then the file gets saved .So how to get rid of this problem .
Also how can i generate different files whenever i start my application so that i dont have to refer my old file for the logs.Does it need any extra configuration in my properties file i m using for log4j??
My properties file is like this.....
Code:
#
# Log for Java configuration don't change unless you know what you doing
# The possible values here are debug, info, warn, error, fatal
#
#log4j.rootCategory=info, R
log4j.rootCategory=debug, R
#
# Dont change this
#
log4j.appender.R=org.apache.log4j.RollingFileAppender
#
# This is the file that becomes the log file. Older log files are renamed as fileName1 fileName2 etc.
#
#log4j.appender.R.File=C:\\jakarta-tomcat-4.0.1\\webapps\\FileXDMS\\WEB-INF\\fileXDMS.log
log4j.appender.R.File=C:/JIGNESH/gmg.log
#
# The maximum size of the log file, good idea to keep the size small.
#
log4j.appender.R.MaxFileSize=100KB
#
# This defines the no of log files to keep. Since this is a rolling file system, after the number of
# files reaches this number, the oldest file is rewritten
#
log4j.appender.R.MaxBackupIndex=10
#
# Dont change this
#
log4j.appender.R.layout=org.apache.log4j.PatternLayout
#
# This defines the way comments are written to the log file, for e.g. %d tells the logger to write the date
# for a full list see the log4j manual. %p is the priority (debug, info etc as defined above)
#
log4j.appender.R.layout.ConversionPattern=%d{dd MMM yyyy HH:mm:ss} -- %p -- %m%n
2)
One more thing i am generating some csv files from my application but they doesn't get deleted while my server remains ON. This should not happen as my application will be used by many users through web..
What i want to do is create the csv files actually they are a form of reports so each individual user should be able to generate report in the file system of their own PC.Currently my files are getting generated on the fileSystem where i m developing my application, ie on server's file system...
So help me sort out these two queries...
Thanks,
Jignesh