WebDriverEventListener和Log4j在同一脚本中的不同属性文件

时间:2016-08-18 07:24:46

标签: selenium-webdriver log4j

我想在自动化脚本中同时使用WebDriverEventListnerLog4j

我想为所有WebDriverEventListner操作创建一个日志,为Log4j操作创建不同的日志。

我有两个属性文件如下:

# for Log4j actions - userDefinedLog.properties
# Define the root logger
log4j.rootLogger=INFO, CONSOLE, HTML

# Define the appender
log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
log4j.appender.HTML=org.apache.log4j.FileAppender

#Define the file location
log4j.appender.HTML.File=./target/Log/userDefinedLog.html

#Define the layout and pattern
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
log4j.appender.CONSOLE.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
log4j.appender.HTML.layout=org.apache.log4j.HTMLLayout
log4j.appender.HTML.layout.Title=User Defined Log
log4j.appender.HTML.layout.LocationInfo=true

log4j.appender.FA.append=false
#for WebDriverEventListner actions - webDriverEventListner.properties
# Define the root logger
log4j.rootLogger=INFO, CONSOLE, HTML

# Define the appender
log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
log4j.appender.HTML=org.apache.log4j.FileAppender

#Define the file location
log4j.appender.HTML.File=./target/Log/eventListener.html

#Define the layout and pattern
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
log4j.appender.CONSOLE.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
log4j.appender.HTML.layout=org.apache.log4j.HTMLLayout
log4j.appender.HTML.layout.Title=WebDriver Event Listener Log
log4j.appender.HTML.layout.LocationInfo=true

log4j.appender.FA.append=false

现在我必须单独指定或启动这些属性文件到Log4jWebDriverEventListner

请帮我解决这个问题。

0 个答案:

没有答案