gpt4 book ai didi

java - Jenkins 显示 log4j 提示 : log4j:WARN No appenders could be found for logger

转载 作者:太空宇宙 更新时间:2023-11-04 14:15:52 25 4
gpt4 key购买 nike

有人可以帮我弄清楚为什么 Jenkins 在 IDE 中运行时一直提示 log4j 吗?我熟悉该错误及其修复方法。我的 src 文件夹中有一个 log4j.properties 文件。当我从 IDE 运行测试时,我没有看到此错误。仅来自 Jenkins 。任何帮助将不胜感激。

这与我链接到的问题不是同一个问题!请阅读问题!这发生在 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.

...

最佳答案

尝试将 log4j.properties 移至构建中的 WEB-INF/classes 或在作业命令中添加 -Dlog4j.configuration=theconfig

关于java - Jenkins 显示 log4j 提示 : log4j:WARN No appenders could be found for logger,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27750177/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com