I am using Logger from Restlet with FileHandler to register my application in production mode. However, I always get Excetption "Unable to create FileHandler for Logger: Failed to get lock for test.log." How can i solve this? Here is the code:
FileHandler aFileHandler = new FileHandler("test.log"); Formatter aFormatter = new SimpleFormatter(); aFileHandler.setFormatter(aFormatter); aLogger.setLevel(Level.ALL); aLogger.addHandler(aFileHandler);
This log file is used by more than one process at a time.
And besides the .log file, many other files have been created, such as ".log.1, .log.2 .....". Does anyone know why?
source share