当您不为log4j2提供配置时,我们都熟悉此消息:
ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console.
如何检查log4j2是否尚未配置,以便在需要时可以使用默认配置进行初始化?
ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console. Set system property 'org.apache.logging.log4j.simplelog.StatusLogger.level' to TRACE to show Log4j2 internal initialization logging.
01:16:25.288 [Client thread] ERROR net.
在我的application.yml里我得到了:
logging:
config: classpath:log4j2.debug.yml
和其他人在不同的侧面。启动应用程序时,会得到以下内容:
ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console.
如果我只是将log4j2.xml放在配置文件旁边,它就能工作。因此,我认为这是一种我错过了依赖关系的东西,或者log4j2是不可能的?
参考资料:说它应该像我尝
我正在尝试在Netbeans中配置Log4j2。
我使用了以下代码:
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
public class App
{
public static void main( String[] args ) {
Logger logger = LogManager.getRootLogger();
logger.trace("Configuration File Defined To Be :: &
我正在尝试将SLF4J设置为与Log4J2一起工作。但是我不断地发现这个错误:
ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console.
以下是我的POM依赖:
<properties>
<log4j.version>2.1</log4j.version>
</properties>
<!-- Logging -->
<dependency
我已经在Java中为OpenOffice (如果这很重要的话)创建了一个扩展。我使用SLF4J和Log4J2进行日志记录。在我的单元测试中,一切都很完美;但是,当我的插件在OpenOffice中运行时,我会在控制台(Linux终端)上得到以下错误消息:
ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console.
我正在用NetBeans构建扩展,使用OpenOffice插件。我更改了构建脚本,以便将log4j2.xm
我有一些与SpringJUnit4ClassRunner一起运行的测试。我也刚刚迁移到Log4j2,现在我在加载log4j2.xml配置文件时遇到了问题,我总是收到这样的错误:
ERROR StatusLogger No log4j2 configuration file found. Using default
configuration: logging only errors to the console.
问题是配置文件不在类路径上。相反,我将它与类路径外的其他配置数据放在一个单独的文件夹中。当我开始测试时,我已经设置了-Dconfig=/path/to/config/f
我有一个用ejb和war打包的Java应用程序。以下是耳朵的结构:
myapp.ear
-lib
-META-INF
-ejbjar1.jar
-ejbjar2.jar
-mywebapp.war
我需要使用log4j2,所以我首先尝试通过遵循从web.xml配置它,但是当我在EJB中创建Logger时,它正在抛出:
ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console.
给出的指令对我来说不太清楚,但我理解我需
我有一个webstart应用程序,它可以很好地工作在Log4j 1上,现在我已经将它迁移到Log4J2了。在Eclipse中,一切都很好。但是,如果我以WebStart应用程序的形式启动它,我总是会得到这样的消息:
"ERROR StatusLogger No log4j2 configuration file found.
Using default configuration:
logging only errors to the console.
Set system property 'org.apache.logging.log4j.simplelog.St
最近,我决定学习如何使用log4j2记录器。我下载了所需的jar文件,创建了库,xml配置文件,并尝试使用它。不幸的是,我在控制台(Eclipse)中得到了以下语句:
ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console.
这是我的测试类代码:
package log4j.test;
import org.apache.logging.log4j.LogManager;
import org.apa
在运行蜂箱时,我会收到以下错误。
>C:\HIVE\bin>hive
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/C:/HIVE/lib/log4j-slf4j-impl-2.4.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/C:/hadoop/share/hadoop/common/lib/slf4j-log4j12-1.7.30.j
我一定是在做些蠢事:
C:\tmp\log>java -jar logorrhea.jar -Dlog4j.configurationFile=c:/tmp/log/mblog4j.properties
ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console.
我按照中的指示设置log4j.configurationFile系统属性,但它似乎不起作用。(有一个名为c:/tmp/log/mblog4j.pro
我有以下财产
# Set the name of the file
log4j.appender.FILE.File="${env:LOG_DIR}/log.out"
我可以看到环境变量
System.out.println(System.getenv("LOG_DIR"));
给我
../../myLogFolder
但是当我运行我的程序时,它会创建一个名为"的文件夹,并在其中创建一个log.out文件。为什么log4j.properties不能获得环境变量的值?
这里是我的maven依赖项
<!-- https://mvnrepository.
我正在尝试用log4j2配置tomcat 7内部日志记录。我遵循了提供的答案。
我使用tomcat 7.0.54和log4j-core-2.1.jar,log4j-api-2.1.jar。我已经下载了附加程序,并完成了下面的所有步骤,但是当我开始使用tomcat时,我得到了一个错误:
ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console.
以下是我执行的步骤:
将log4j2.xml放在$CATALINA_B
我使用log4j创建了一个自定义的ConfigurationBuilder配置,并且希望初始化这个配置,然后开始使用log4j,在其他情况下,当项目初始化时没有配置文件.
根据下的这个页面,使用ConfigurationBuilder和Configurator重新配置Log4j,它说-
An alternative to a custom ConfigurationFactory is to configure with the Configurator. Once a Configuration object has been constructed, it can be passed to
我能够使用log4j2构建简单的java应用程序。但是,当我运行该应用程序时,我会收到以下错误消息:
$ gradle run
:compileJava UP-TO-DATE
:processResources UP-TO-DATE
:classes UP-TO-DATE
:run
ERROR StatusLogger No Log4j 2 configuration file found. Using default configuration (logging only errors to the console), or user programmatically provided co
让log4j开始工作要比宣传的要复杂得多。我一直在犯这个错误:
ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console.
我试着把我的log4j.xml文件放在整个地方,但我想要的是把它放在我的/resources文件夹中。在我的pom.xml中,定义了这些路径:
<properties>
<src.dir>src/</src.dir>
<test.di
我试图在一个简单的log4j项目中设置。在运行我的项目时,我一直收到以下消息。
ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console.
但是,我在类路径中添加了log4j.xml。例如,我是否在我的主要方法中这样做:
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import java.io
我的Eclipse应用程序包括一个封装第三方框架的插件。这个框架是一个纯OSGi系统,使用SLF4J。我自己的应用程序使用log4j 2,它工作得很好。第三方框架似乎承认“我的”log4j 2很好,但是触发了通常的ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console.消息。
将log4j2.xml文件添加到src/main/resources文件夹(是的,并将其添加到构建中)没有任何效果。
如何为第三方框架的SL
在升级log4j 1.x到log4j2时,我面临下面的错误。根据log4j2站点上的文档,我已经在log4j2文件下面准备好了,但是我仍然得到了这个异常。
Log4j2版本: 2.6.1,Weblogic: 10.3.6,JDK1.7.x
请帮助处理此例外情况:
2016-06-25 05:49:36,002 [ACTIVE] ExecuteThread: '70' for queue: 'weblogic.kernel.Default (self-tuning)' ERROR Unable to invoke factory method in class c