Top "Log4j2" questions

Log4j 2 is an upgrade to Log4j, a Java-based logging utility, that provides significant improvements over its predecessor, Log4j 1.x, and provides many of the improvements available in Logback while fixing some inherent problems in Logback's architecture.

Log4j2: How to write logs to separate files for each user?

Here is the challenge I'm facing: I have a servlet program. And I need to write logs for each user …

java logging configuration log4j log4j2
How to add the date timestamp to log4j2 logfiles?

I want to create day dependent logfiles with log4j2: <RollingFile name="APP" fileName="application-%d{yyyy-MM-dd}.log" /> …

java log4j log4j2
Reload log4j2 configuration on demand

I have my log4j2.xml config file set to be checked every 30 seconds: <Configuration status="WARN" monitorInterval="30"> ... &…

java logging configuration log4j log4j2
Log4J2 configuration in 3.0 servlet

I tried to set up LOG4J according documentation (and related SO questions), but it does not create supposed file, …

java logging log4j log4j2 servlet-3.0
How to properly shutdown log4j2

If one is not running inside a web application, what is the proper way to shutdown Log4j2? I only …

java logging log4j log4j2 application-shutdown
What is a sample default config file in YAML for log4j2?

The documentation for log4j2 configuration provides a nice sample XML document equivalent to the default configuration: <?xml version="1.0" …

yaml log4j2
How to use multiple configuration files for log4j2

I am writing Java code that tests a Java library. The library includes its own log4j2 configuration as part …

java xml logging log4j2 xinclude
How to log within shutdown hooks with Log4j2?

Log4j2 also uses shutdown hooks to end it's services. But of course I want to log throughout the whole …

java logging log4j2 application-shutdown
Use Spring boot application properties in log4j2.xml

I am working on a web application based on spring boot and want to use log4j2 as the logger …

spring-boot log4j2
Log4j2/JPA/Hibernate logging is not working

I can't make hibernate log messages with log4j2. It logs only INFO and WARN. On the other side HikariCP …

java hibernate logging orm log4j2