user920041
user920041

Reputation:

How can I set a custom log4j properties file in DEV mode in Play! Framework?

I have a log4j.properties with production spesific log settings:

log4j.appender.Rolling.File=${catalina.home}/logs/thelog.log

But this does not work any good localhost. I have tried to set a different log file if in DEV mode without luck:

%dev.application.log.path=/log4j_local.properties

It seems that this application settings is not applied if I have the log4j.properties file in the conf folder.

Is there a way to have different logging settings in PROD and DEV mode?

Upvotes: 1

Views: 1712

Answers (2)

Dominik Dorn
Dominik Dorn

Reputation: 1831

%test.application.log.path=/log4j.test.properties

and put the contents into yourprojectroot/conf/log4j.test.properties

Upvotes: 1

Raphaël Lemaire
Raphaël Lemaire

Reputation: 1309

The logger configuration file path can be overridden when launching the server, as described here : http://www.playframework.org/documentation/2.0/SettingsLogger

Hope it helps. Regards,

Upvotes: 0

Related Questions