ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console.
The status logger did not find the log4j2 configuration file and will use the default configuration: only errors are logged to the console.
The jar package of log4j2
is log4j2
that comes with the hibernate5
framework. Even if you import a third-party log package in ssh, the system will still call log4j2
. The default configuration file is log4j2.xml
.
Add configuration file log4j2.xml
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="warn">
<Appenders>
<Console name="Console" target="SYSTEM_OUT">
<PatternLayout pattern="%m%n" />
</Console>
</Appenders>
<Loggers>
<Root level="INFO">
<AppenderRef ref="Console" />
</Root>
</Loggers>
</Configuration>
log4j2
is configured, hibernate will output clearer information to the console. When set to status="warn", you will see various detailed output inside log4j2.classpath
, create a new resources directory in the above project to store log4j2.xml
, if you try to run it without adding the classpath
, an error will be reported.The new hibernate internal log information in the console:
08:01:59,522 INFO C3P0Registry:216 - Initializing c3p0-0.9.2.1 [built 20-March-2013 10:47:27 +0000; debug? true; trace: 10]
HHH000412: Hibernate Core {5.0.7.Final}
HHH000206: hibernate.properties not found
HHH000021: Bytecode provider name : javassist
HCANN000001: Hibernate Commons Annotations {5.0.1.Final}
08:02:00,084 INFO AbstractPoolBackedDataSource:522 - Initializing c3p0 pool... com.mchange.v2.c3p0.ComboPooledDataSource [ acquireIncrement -> 3, acquireRetryAttempts