No log4j2 configuration file found. Using default configuration: logging only errors to the console

Problem 1 ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console. Solution 1 To work with version 2 of log4j aka “log4j2” -Dlog4j.configuration= should read -Dlog4j.configurationFile= 1.2 manual: http://logging.apache.org/log4j/1.2/manual.html 2.x manual: http://logging.apache.org/log4j/2.x/manual/configuration.html Problem 2 log4j:WARN …. Solution 2 In your project, uninclude the log4j-1.2 jar and instead, include … Read more

What does “status” mean in Log4j2 configuration?

The status logger is used internally by log4j2 components. Setting status=”debug” (or “trace”) in the configuration will cause this internal logging to be output to the command line. It will print debug information about which log4j2 plugin components are loaded (all configuration elements map to log4j2 plugins), and more details like for example what appenders … Read more

Programmatically change log level in Log4j2

The Easy Way : EDITED according to log4j2 version 2.4 FAQ You can set a logger’s level with the class Configurator from Log4j Core. BUT be aware that the Configurator class is not part of the public API. // org.apache.logging.log4j.core.config.Configurator; Configurator.setLevel(“com.example.Foo”, Level.DEBUG); // You can also set the root logger: Configurator.setRootLevel(Level.DEBUG); Source The Preferable Way … Read more

Very simple log4j2 XML configuration file using Console and File appender

<?xml version=”1.0″ encoding=”UTF-8″?> <Configuration status=”INFO”> <Appenders> <Console name=”Console” target=”SYSTEM_OUT”> <PatternLayout pattern=”%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} – %msg%n” /> </Console> <File name=”MyFile” fileName=”all.log” immediateFlush=”false” append=”false”> <PatternLayout pattern=”%d{yyy-MM-dd HH:mm:ss.SSS} [%t] %-5level %logger{36} – %msg%n”/> </File> </Appenders> <Loggers> <Root level=”debug”> <AppenderRef ref=”Console” /> <AppenderRef ref=”MyFile”/> </Root> </Loggers> </Configuration> Notes: Put the following content in your configuration file. Name the … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)