当前位置: 首页 > 知识库问答 >
问题:

Jenkins显示log4j抱怨:log4j:warn找不到logger[duplicate]的附加项

笪煌
2023-03-14

有人能帮我弄清楚为什么Jenkins在IDE上工作时一直抱怨log4j?我很熟悉这个错误和它的修复方法。我的src文件夹中有一个log4j.properties文件。当我从IDE运行测试时,我看不到这个错误。只从詹金斯那里。如有任何帮助,我们将不胜感激。

这不是同一个问题与我的链接!请看问题!这发生在JENKINS,而不是IDE中。

Started by user anonymous
Building in workspace C:\Users\userm4\.jenkins\jobs\Company Smoke Test\workspace
[Selenium Main] $ cmd.exe /C '"C:\apache-ant-1.9.4\bin\ant.bat -file TestNG run makexsltreports && exit %%ERRORLEVEL%%"'
Buildfile: E:\Selenium Main\TestNG\build.xml

setClassPath:

init:

clean:
   [delete] Deleting directory E:\Selenium Main\TestNG\build

compile:
     [echo] making directory...
    [mkdir] Created dir: E:\Selenium Main\TestNG\build
     [echo] classpath------: E:\Selenium Main\TestNG\lib\SaxonLiaison.jar:E:\Selenium Main\TestNG\lib\jtds-1.3.1.jar:E:\Selenium Main\TestNG\lib\junit-4.11.jar:E:\Selenium Main\TestNG\lib\log4j-1.2.17.jar:E:\Selenium Main\TestNG\lib\mysql-connector-java-5.1.34.jar:E:\Selenium Main\TestNG\lib\saxon-8.7.jar:E:\Selenium Main\TestNG\lib\selenium-java-2.44.0.jar:E:\Selenium Main\TestNG\lib\selenium-server-standalone-2.44.0.jar:E:\Selenium Main\TestNG\lib\testng-6.8.8.jar
     [echo] compiling...
    [javac] E:\Selenium Main\TestNG\build.xml:66: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
    [javac] Compiling 52 source files to E:\Selenium Main\TestNG\build

run:
   [testng] [TestNG] Running:
   [testng]   E:\Selenium Main\TestNG\testng.xml
   [testng] 
   [testng] log4j:WARN No appenders could be found for logger (org.apache.http.client.protocol.RequestAddCookies).
   [testng] log4j:WARN Please initialize the log4j system properly.
   [testng] log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.

共有1个答案

张茂勋
2023-03-14

尝试在生成中将log4j.properties移动到web-inf/classes或在作业命令中添加-dlog4j.configuration=theConfig

 类似资料: