I want to start selenium server with log4j so that all server related logs go there. I'm starting the server with ANT using the following ANT target
<target name="startserver" depends="setClassPath">
<java jar="${test.home}/lib/selenium-server-standalone-2.20.0.jar" fork="true">
<arg line="-Djava.util.logging.config.file=log4j.properties"/>
<arg line="-firefoxProfileTemplate 'D:\selenium.default'"/>
<arg line="-browserSideLog"/>
</java>
</target>
My log4j.properties is as below:
log4j.rootLogger=INFO, R, stdout
log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=./logs/sellog.log
log4j.appender.R.MaxFileSize=10MB
log4j.appender.R.MaxBackupIndex=1
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target=System.out
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n
But I'm not getting any server logs after I start the server from the target.
Also, I have a selenium test where I'm throwing the log into log4j as below:
private LogManager lm;
private Logger logger = lm.getLogger(this.getClass().getName());
logger.info("Selenium Client started...");
I'm getting application logs in log4j log.
What I want is to have all the logs (selenium server log + app log) in log4j log.
Any help is greatly appreciated.
No comments:
Post a Comment