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
0 answers

Zip a Log4j-file from another date on startup

I know that with log4j the user has the possibility to compress a file at rollover. But is there a possibility to stop my application, start it again on the next day and still compress the file, that has been created yesterday and therefore contains…
Julius
  • 11
  • 1
1
vote
1 answer

Logs are writing in console but not writing to log file

Recently I migrated from log4j1.x to log4j2.x. I had replaced log4j.properties with log4j2.properties file. I am getting logs printed in my console but logs are not printing in sac.log file. Pom…
007_programmer
  • 35
  • 1
  • 10
1
vote
0 answers

Spring boot 2.6.6 defect with Kafka appender

I want to upgrade my app in order to use the updated version of spring boot. Also, i am using log4j2 with a Kafka appender. Although, when i upgrated to 2.6.6. version from 2.6.4 i had the following error: ConfigException: No resolvable bootstrap…
1
vote
1 answer

Grails 2.5.4 does not log anything when running with run-app after upgrading log4j

I am trying to upgrade the version of log4j in my grails 2.5.4 application from 1.2.17 to 2.17.2. I am able to build and deploy the war and have all the logs work as expected, but the app does not log anything when running with grails run-app…
1
vote
1 answer

Unable to send the logs to Splunk Enterprise local using log4j2

I'm using log4j2 and splunk within java to send logs into my Splunk Enterprise HEC (HTTP Event Collector) Splunk Enterprise is running in my local machine. I'm doing all log4j2 configuration programmatically. (I know this is not the correct way to…
SE123987
  • 29
  • 5
1
vote
0 answers

Logs are not populating with Log4j 2.17.2

We have older java code which was using log4j 1.17 and application logs were writing to log file properly. As part of vulnerability fixing we have to migrate to log4j 2.17.2 (Mandatory as part of compliance). We have followed the migration plan as…
Cris_new
  • 55
  • 1
  • 10
1
vote
1 answer

Configure composite filter for specific logger in Log4j2 via properties file

Log4j2 provides various kind of filters [1] and these can be configured at four levels: Context-wide Logger Appender Appender Reference In my use-case, I would like to setup a CompositeFilter at a specified Logger (level 2 from above) using the…
zabetak
  • 412
  • 4
  • 13
1
vote
1 answer

Getting org.apache.commons.logging.LogConfigurationException

I was working on upgrading log4j1.x to log4j2.x. For that I replace log4j1.x with log4j2.17.1(get both log4j-core and api) and my pom file has commons-logging with version 1.2. I had replaces log4j.properties with log4j2.properties file. After…
007_programmer
  • 35
  • 1
  • 10
1
vote
0 answers

Change jena-fuseki logging level

There's quite little information on jena-fuseki logging on apache documentation, found just this: https://jena.apache.org/documentation/fuseki2/fuseki-logging.html My jena-fuseki in running in rkt-container, started by command ./fuseki-server ... I…
Jaana
  • 266
  • 1
  • 3
  • 14
1
vote
1 answer

Logging with JSON GELF format in Spring Boot

I'm using Spring Boot and would like to have this code: LOG.info("Scheduled appointment for user 12345 [appointment ID 100]"); Produce the following log message in JSON GELF format: { "version": "1.1", "host": "hostname.ec2.internal", …
kernelpanic
  • 1,158
  • 5
  • 17
  • 36
1
vote
1 answer

Log4j2 - Transaction logging in file and application logging on console

I am developing a logger where certain transaction messages need to be logged to a file and some application logs need to be logged to the console. Currently, the transaction messages are also being logged onto the console and I want to avoid…
1
vote
2 answers

Getting IllegalStateException from Log4j when deserializating JMS ObjectMessage

I have an application that send a log message over to JMS (ActiveMQ) and a process that consumes the log message puts to a database. It worked with log4j 1.x. After upgrading to log4j2, with the same version of ActiveMQ (compiled and runtime both…
Ashish
  • 47
  • 1
1
vote
0 answers

log4j2 starting from 1 after restarting application

Hi I am using log4j2 and using rollover based on time and size. I am using file name as Application.log ,when rollover happens , previous filename appends with index but after system restarts count is again starting from 1 instead of continuing…
1
vote
1 answer

How to use log4j and log4j2 properies file to log into same file

I want to roll and compress log files based on size and time. I have found out that this can easily be performed with log4j2. The problem is many internal jars still use log4j for logging, which I want to be logged. The possible solution I can think…
Abhishek
  • 15
  • 4
1
vote
0 answers

Log4j2 kafka appender failover is not working and with this error "Broker may not be available"

I have this log4j2.xml file I don't understand why Failover appender is not working when Kafka appender is failing. My Kafka appender is: