• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java logging : java.util.logging.config.file - accessing logging.properties in classpath

 
Reshma Sadhwani
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I have a standalone java application using java logging. I have placed logging.properties in:

com.pkg1.pkg2

I am setting following system property:

-Djava.util.logging.config.file=com/pkg1/pkg2/logging.properties

Unfortunately, the java logging code is not able to locate this file. On debugging into java.util.logging.LogManager.java, it looks like this line of code may be the cause:

InputStream in = new FileInputStream(fname); Here fname = com/pkg1/pkg2/logging.properties and it cannot find the file.

Where should I place logging.properties and how do I set that location in env variable value?

-Djava.util.logging.config.file = WHAT_TO_PUT_HERE?

This app jar is going to run on unix server.

Appreciate your help,thanks.

 
Paul Clapham
Sheriff
Posts: 21416
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just put the full absolute path of the properties file. Don't use a relative path unless you are sure you can control the current working directory when the application is run, and if you can then make the path relative to that directory.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic