I just tested it with the following dependencies:
Code:
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<version>2.8.2</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.8.2</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.8.2</version>
</dependency>
And this log4j2 config:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
<Appenders>
<File name="MyFile" fileName="logs/app.log">
<PatternLayout>
<Pattern>%d %p %c{1.} [%t] %m%n</Pattern>
</PatternLayout>
</File>
</Appenders>
<Loggers>
<Root level="info">
<AppenderRef ref="MyFile"/>
</Root>
<Logger name="org.hibernate" level="debug"/>
<Logger name="org.hibernate.SQL" level="debug"/>
<Logger name="com.zaxxer.hikari" level="debug" />
</Loggers>
</Configuration>
And it woks just fine.