aspose file tools*
The moose likes Java in General and the fly likes Log file created for every invocation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Log file created for every invocation" Watch "Log file created for every invocation" New topic
Author

Log file created for every invocation

Siva Masilamani
Ranch Hand

Joined: Sep 19, 2008
Posts: 385
Hi

I am trying to write a simple program to log the application data using Java logging API.As we are using Java 1.2 ,i am using LumberJack for logging.


The problem is everytime i run the class a new log file is created like filename.log.0,filename.log.1 and so on.

How do i avoid this?Also i would like to know how to rollover the old log file and create a new log file everyday?I know we could do it in Log4j using org.apache.log4j.DailyRollingFileAppender but how would i get the same thing here also?

This class runs only if there is logging.properties file is in the jdre/lib folder which JDK1.2 doen't have.So i manually create a empty file with such a name under the lib directory.How do i make the jvm look for the location i specified in the program instead of lib directory?

Please find below the code and property file.




Please help


SCJP 6,SCWCD 5,SCBCD 5

Failure is not an option.
 
jQuery in Action, 2nd edition
 
subject: Log file created for every invocation