I am using Logger from Restlet framework with FileHandler to log my application in production mode. However, I always get the Excetption "Unable to create a FileHandler for the Logger: Couldn't get lock for test.log". How can I solve this?
Here is the code:
FileHandler aFileHandler = new FileHandler("test.log");
Formatter aFormatter = new SimpleFormatter();
You should provide full Class Names.
FileHandler are ambiguous. However I guess you are using some kind of logger maybe Log4j and a RollingFileAppender which is why your files are getting rotated i.e. xxx.log.1 & xxx.log.2.
Your file is being used by some other process/application which is why you are not able to get a lock on that file.