1

I am using a Java Logger in my application with FileHandler set to /DemoApp/AAA.log. But my JVM creates empty java.log and java.log.lck files in my home directory every time i run the app.

Does any one have any idea why this is happening?

Sunny
  • 286
  • 1
  • 4
  • 14

1 Answers1

0

Try loading this property file as the logger configuration:

handlers=java.util.logging.FileHandler
java.util.logging.FileHandler.level=ALL
java.util.logging.FileHandler.append=true
java.util.logging.FileHandler.formatter=java.util.logging.SimpleFormatter
java.util.logging.FileHandler.pattern=testlog%u.log

.level=ALL

This should output a testlog0.log file to the working directory of the program. If this does not solve the problem, please provide a minimal example. Also keep this in mind when using directories.

Community
  • 1
  • 1
seeker
  • 671
  • 7
  • 13