Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where should I put logging.properties file for java.util.logging in web application (maven project)?

I want to logging to file and set it in properties file, because default logger.info() output goes to console and in web application there is no console in my case.

like image 259
hello_world Avatar asked Jan 17 '11 15:01

hello_world


People also ask

Where do I put logging properties file?

By default, the logging. properties file is located in the /user/bdd/edp/lib directory. The hdfsEdpLibPath property in the data_processing_CLI file controls the location of this file in HDFS. A comma-delimited list of handler class names that are added to the root Logger.

How do you add a logger to a Java program?

The process of creating a new Logger in Java is quite simple. You have to use Logger. getLogger() method. The getLogger() method identifies the name of the Logger and takes string as a parameter.


2 Answers

As Navi says... it goes in src/main/resources

Just to clarify this subject... the logging.properties must go in WEB-INF/classes directory. If you are using some kind of framework for organizing your project, you must find out where to place the file in order to stay in WEB-INF/classes If you are using maven to organize the web app, you must know that everything that lies in src/main/resources goes to WEB-INF/classes.

like image 122
Victor Avatar answered Oct 12 '22 11:10

Victor


you should put in src/main/resources

like image 43
Navi Avatar answered Oct 12 '22 11:10

Navi