Latest Questions tagged Log4j

Browse all latest questions tagged Log4j

56
Votes
Published 26 Oct, 2022
Java - Logs are not loading according to Log4j2.properties

I am upgrading to Log4j to Log4j2 in my project. I have put log4j2.properties in the classpath, and its loading. Despite that logs are not coming according to properties defined in log4j2.properties....

75
Votes
Published 15 Sep, 2022
Java - What is the result of making log4j additivity equals to true or false?

In simple terms what is the result of making additivity="true" or additivity="false" when adding a Log4j configuration for a specific class like this? <Logger name="com.mypage.glass.TryWindow" lev...

56
Votes
Published 19 Sep, 2022
Java - Log4j 2. How get log4j's debug messages?

As far as i understand log4j can handle system property -Dlog4j.debug. If you run your app with it you will get log4j's debug output. Example: java -Dlog4j.debug -jar test.jar Is there something sim...

76
Votes
Published 15 Aug, 2022
Java - How to get Log4j to use stdout?

I'm currently using log4j in some code I'm working on for debugging purposes. I've been running my code with java -jar test.jar | tee file.txt to log to a file but now I want to be able to switch the...

18
Votes
Published 07 Sep, 2022
Java - Can't turn off HttpClient Wire debug log messages

I have been trying to set Wire to not send DEBUG to console, but no matter what I do, it won't listen. I have log4j initialized properly: I do not get any appender messages, log4j is obeying my cla...

41
Votes
Published 13 Sep, 2022
Java - log4j configurations with daily rolling, gzip and max backup files

Is there an appender that I can use that will get me daily rolling, compression and max files? I can get daily rolling file with compression using apache-log4j-extras with this configuration: <appe...

40
Votes
Published 07 Sep, 2022
Java - Making a log4j console appender use different colors for different threads

I am tracking down some concurrency issues and it would be very helpful to have the output lines from each thread in a different color when logging to a console. I am on OS X. Could this be done using...

13
Votes
Published 30 Aug, 2022
Java - slf4j in library seems to ignore my log4j2 configuration

We use Log4j2 in our java-ee application. We use a library, where logging is programmed against SLF4J. In this library is a class, which logs a lot of stuff I do not want -> so I want to set LogLevel...

96
Votes
Published 19 Sep, 2022
Java - Java Log Viewer

Unfortunately, sometimes the only way to debug a program is by going through its long log files. I searched for a decent log viewer for a while now, and haven't found a real solution. The only progr...

240
Votes
Published 11 Sep, 2022
Java - What are markers in Java Logging frameworks and what is a reason to use them?

The first time I heard about markers was while reading: http://slf4j.org/faq.html I checked available methods for the Logger object: http://www.slf4j.org/api/org/slf4j/Logger.html http://logging.apac...

6
Votes
Published 04 Sep, 2022
Java - how to log only one level with log4j2?

I'm using log4j2 in my application. What I want is everything up to 'debug' to go to console, everything up to 'info' to go to myapp.log, and ONLY 'info' to go to 'myapp-audit.log'. The reason is, I...

130
Votes
Published 30 Aug, 2022
Java - Log4j vulnerability - Is Log4j 1.2.17 vulnerable (was unable to find any JNDI code in source)?

With regard to the Log4j JNDI remote code execution vulnerability that has been identified CVE-2021-44228 - (also see references) - I wondered if Log4j-v1.2 is also impacted, but the closest I got fr...

10
Votes
Published 19 Aug, 2022
Java - How do I configure log4j to send log events to java.util.logging using JULAppender?

I am familiar with the java.util.logging (JUL) framework, I use it extensively. Recently, I started using a library that does its logging through log4j. When I start my application I now get the...

114
Votes
Published 11 Aug, 2022
Java - How to Create a Custom Appender in log4j2?

As disscussed in this link : How to create a own Appender in log4j? For creating a custom appender in log4j 1.x we have to extend the AppenderSkeleton class and implements its append method. Similar...

37
Votes
Published 09 Aug, 2022
Java - How to add appender to Logger in Log4j2

In Log4j 1.2, you could simply take a logger and add an appender at runtime. This was handy for test purposes for instance. We used to create a mock appender and add it to the logger. Subsequently we...