Questions tagged [log4j2]

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 is a standalone upgrade to Log4j 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.x changes the API and is no longer downward compatible to log4j1.x

See Also

4386 questions
1
vote
1 answer

Log4j2 configuration issues, does noy make sense to me anymmore

Now I gave up. I have been struggling with this issue for far too long. Configuring log4j makes logical sense and I thought I understand it, but apparently not. Searching for help has not yielded any results and it feels like I always get the same…
1
vote
1 answer

Log4j Migration - How to migrate Custom File Appender with log4j bridge or logj2

I have one customer appender class that was implemented in log4j 1 as below: import org.apache.log4j.FileAppender; import org.apache.log4j.helpers.CountingQuietWriter; import org.apache.log4j.helpers.LogLog; ... public class CustomFileAppender…
someone_ smiley
  • 1,006
  • 3
  • 23
  • 42
1
vote
0 answers

Problems writing log to a shared docker volume

I have not been able to connect the containers of my app and promtail via volumes so that promtail can read it. I have an app that creates log files (by log4j2 in java ) to a folder with the extension appXX.log, when I share volumes my app is not…
Illidan
  • 149
  • 1
  • 8
1
vote
1 answer

Log4j2 Different color per logger

In my project I use Log4j 2.17.1. I would like to format the output so that the class names have different colors. public class MyClass { Logger LOGGER = LogManager.getLogger(MyClass.class.getSimpleName()); //... LOGGER.debug("Some…
EchtFettigerKeks
  • 1,692
  • 1
  • 18
  • 33
1
vote
0 answers

Log4j2 only works partially after migration from log4j

We want to migrate a Java 7 web app from log4j 1.2.12 to log4j 2.12.4 and modify the app as less as possible. The app was using SLF4J and including this dependencies: log4j slf4j-api slf4j-log4j12 jcl-over-slf4j And excluding all possible…
ImiChau
  • 81
  • 1
  • 3
1
vote
1 answer

Can I change OptaPlanner's logging level when using it as a local project dependency?

I have a project in Eclipse which uses OptaPlanner (v8.12.0). I want to be able to write temporary debug statements within the OptaPlanner code itself, so I: cloned the repo, checked out branch 8.12.x, built using mvn, imported as a pre-existing…
Ryan Moser
  • 123
  • 1
  • 12
1
vote
1 answer

How to store json value using JDBC appender

I would like to store a JSON field through JDBC appender using Log4j 2. This is my configuration and I am not able to store into PostgreSQL JSON type column:
giaffa86
  • 708
  • 1
  • 9
  • 22
1
vote
1 answer

Using log4j1.2-2 bridge, is it possible to dynamically configure the log settings

We are using the log4j1 to log4j2 bridge, log4j-1.2-api-2.17.1.jar And our code uses the PropertyConfigu System.getProperty( "appserver.Name" ); System.setProperty( "appserver.Name", "/usr/local/logs/server3" ); l4jprops.put( "appserver.Name",…
Berlin Brown
  • 11,504
  • 37
  • 135
  • 203
1
vote
3 answers

Setting system properties for Log4j in Tomcat

From this article, to enable the Log4j 1.2 bridge, you should Set the system property “log4j1.compatibility” to a value of “true”. Log4j 2 will then add log4j.properties, log4j-test.properties, log4j.xml and log4j-test.xml to the configuration…
Gary Liu
  • 41
  • 1
  • 6
1
vote
0 answers

Disable log4j2 scripting configuration module

I'm using Log4j2 in a scala application but noticed that it loads several scripting engines to process its configuration using JSR 223 (see "Scripts" session in https://logging.apache.org/log4j/2.x/manual/configuration.html). We don't really need…
1
vote
1 answer

How to delay log file creation until Appender fileName is set programmatically for log4j2

I have a project with log4j properties defined in xml.
Barry
  • 216
  • 1
  • 3
  • 13
1
vote
0 answers

Logs are added in old rotated file instead of new file

Below is my log4j2.xml file:
Altaf Shaikh
  • 41
  • 1
  • 6
1
vote
1 answer

Log4j2 Servlet Appender

I'm using Tomcat 10 (actually TomEE but it uses Tomcat 10 underneath) and I'm trying to setup log4j2 logging. I have this half working in that logging to the console happens (I have log output in catalina.log). What I can't get working is the…
1
vote
2 answers

Log4J2 2.11.0 -> Log4J2 2.17.1 upgrade - appender broken for mariaDB JDBC driver to Percona 5.7 - malformed packets - maven - solved

I'm trying to upgrade as detailed above. Going from Log4J 2.11.0 to 2.17.1 completely breaks my runtime Log4J database appender setup, breaking in the underlying MariaDB JDBC driver when trying to write log entries to Percona 5.7 / MySQL 5.7. 2.11.0…
Stefan
  • 316
  • 2
  • 16
1
vote
1 answer

Internal Grails logs appearing after log4j2 upgrade

I'm upgrading log4j dependency in my grails 2.5.4 application from 1.2.17 to the latest version 2.17.1 I've excluded log4j from the BuildConfig.groovy and added the following dependencies pertaining to…
dev-eloper
  • 110
  • 11
1 2 3
99
100