Thats what I tried at first and it did not work. I also tried
different variations and all of them failed:
%dev.application.log.path=log4j-dev.properties
%prod.application.log.path=log4j-prod.properties
%dev.application.log.path=conf/log4j-dev.properties
%prod.application.log.path=conf/log4j-prod.properties
%dev.application.log.path=/conf/log4j-dev.properties
%prod.application.log.path=/conf/log4j-prod.properties
It only works if I comment out the log path setting and have a simple
log4j.properties file in my conf folder.
-----------------------------------
Sample Code:
-----------------------------------
import org.apache.log4j.Logger;
public class TestController extends Controller {
private static final Logger log =
Logger.getLogger(TestController.class);
public static void test(){
log.debug("test"); // does not work
log.info("test-info");// does not work
play.Logger.info("play-logger-info"); // works
play.Logger.log4j.debug("play-loger-debug"); // does not work
play.Logger.log4j.getLogger(TestController.class).debug("GNAAA !!"); //
does not work
}
-----------------------------------
Sample Config for DEV:
-----------------------------------
log4j.rootLogger=ERROR, Console
log4j.logger.play=INFO
log4j.logger.controllers.TestController=DEBUG
# Console
log4j.appender.Console=org.apache.log4j.ConsoleAppender
log4j.appender.Console.layout=org.apache.log4j.PatternLayout
log4j.appender.Console.layout.ConversionPattern=%d{ABSOLUTE} %-5p ~ %m
%n