Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add log4J properties file with sbt and onejar plugin?

Tags:

scala

sbt

I am trying to build a one jar file with sbt on a scala/java project. All the project is correctly built and packaged except the log4J configuration file.

I did not find how to include it in the classpath of the final jar.

I tried to add it to unmanagedBase in the build.sbt file without success.

How can I do that ?

like image 503
Yannick Chaze Avatar asked Feb 08 '13 09:02

Yannick Chaze


People also ask

Where should I place log4j properties file?

The file is named log4j. properties and is located in the $DGRAPH_HOME/dgraph-hdfs-agent/lib directory. The file defines the ROLLINGFILE appenders for the root logger and also sets the log level for the file. The level of the root logger is defined as INFO and attaches the ROLLINGFILE appender to it.

Where is log4j properties file located in Tomcat?

Log4j and Tomcat Libraries are placed in common library directory. The configuration file for Tomcat is in common/classes directory, the configuration file for a application is placed in the WEB-INF/classes folder of the application.


1 Answers

It should work if you place the file in src/main/resources.

like image 100
Joel Arnold Avatar answered Sep 23 '22 14:09

Joel Arnold