Skip to main content
Filter by
Sorted by
Tagged with
0 votes
1 answer
37 views

Springboot with logback working, with log4j2 working, but not working when using both

I am observing an issue when sending logs to both log4j2 and logback using kafka. Here is the code of my very simple Springboot app: @SpringBootApplication public class QuestionApplication { ...
PatPanda's user avatar
  • 4,802
0 votes
1 answer
23 views

Use Environment Variables With Conditional Logic on Log4j2.properties

I'm using Log4j2 with a log4j2.properties configuration file, and I rely on environment variables for some settings. Here's a sample of my configuration: rootLogger.level = INFO rootLogger....
ypanag's user avatar
  • 291
0 votes
1 answer
47 views

log4j2 not printing any log messages with debug severity

I am running a spark program scala where I am stuck with this particular scenerio where my log messages with debug severity are not being printed. Here is my code snippet object TestLogging{ @...
Vikas Saxena's user avatar
  • 1,173
-1 votes
1 answer
39 views

Store app logs in AWS Cloudwatch using Log4J2 appender

I'm trying to store application-level logs in AWS Cloudwatch logs from spark structured streaming application I am trying to using Log4J2 cloudwatch appender from following github repo (link is https:...
Karthik's user avatar
  • 1,171
1 vote
0 answers
17 views

Log4j2 RollingFile configuration is not working with efs ( elastic file system ) for SizeBasedTriggeringPolicy policy

I'm trying to implement the RollingFile policy, but rolling is not executed even though the log file size is more than 50MB. The log files are on efs. The current version of Log4j is 2.17.1. <...
VijayD's user avatar
  • 820
0 votes
1 answer
29 views

Log4j2 configuration XML schema does not allow the <Route></Route> block to accept nested elements

I am designing a logging mechanism for my server where each user will have their own log folder named after their employeeId, and the log files within each folder are named after the dates. To achieve ...
trungthao Oto's user avatar
0 votes
1 answer
32 views

Unix time is not working with log4j to perform file rollover

I am using %d{UNIX} with apache log4j which is not working gradle file: implementation group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.24.1' implementation group: 'org.apache.logging....
RCS's user avatar
  • 1,422
0 votes
0 answers
21 views

Log4j2 - Log Custom Object With Nested Objects as JSON

I need to log a custom object as plain JSON string, without any extra log event details. I tried to use org.apache.logging.log4j.message.MapMessage (solution is described here https://stackoverflow....
user07's user avatar
  • 415
0 votes
0 answers
17 views

log4j2 JSONLayout, how to nest the default json log inside a custom json

I have the following log4j2.xml (with log4j2 version at 2.24 as of this writing) <?xml version="1.0" encoding="UTF-8"?> <Configuration status="info" name="...
PatPanda's user avatar
  • 4,802
1 vote
1 answer
82 views

Loggers are not printing on OpenShift Console after deployment

I'm using Log4j - 2.22.1. version and wildfly- 31.0.1.Final Loggers are printing in local But, while deploying it on openshift the loggers are not printing after the ear is deployed and i checked the ...
Paul's user avatar
  • 11
1 vote
1 answer
73 views

experiensing "Protocol vfs has not been enabled as an allowed protocol" error while deploying the Spring boot WS to JBoss EAP 8

I am working on developing a spring boot(3.3.5) web service with log4j2 as my logging library. I generated a spring boot project from spring initializer, excluded the logging from web module to ...
Munny's user avatar
  • 91
0 votes
1 answer
42 views

Log4j2 asyncLogger missing log events in application log files

I am using Log4j2's AsyncLogger in my Java application, which is deployed on a Kubernetes environment. The application is also configured with the New Relic Java agent, and I can see log events ...
Muhammad Abu Bakr's user avatar
0 votes
0 answers
15 views

Log4j2 YAML Configuration Not Loaded in Deployed Environment When Using Custom Logging Library in Spring Boot

I'm developing a Spring Boot application (Project A) that uses a custom logging library (Dependency B) to encapsulate all logging configurations, including Log4j2 with a log4j2.yaml file. Problem: ...
Rodrigo Mac-knight's user avatar
2 votes
1 answer
45 views

Library using sfl4j not following log42.xml configurations

I'm using the kafka-clients library in my Java application, and the logs are just not getting appended to the Kafka log I specified in my log4j2.xml. However, the org.springframework.kafka logs are ...
IceTea's user avatar
  • 650
0 votes
1 answer
60 views

Filter console exceptions in Log4j from executed jar

I am running a minecraft server and some addons keep spamming the console (and hence making it useless) with the following: com.mojang.brigadier.exceptions.CommandSyntaxException I want to get rid of ...
OnlyTheBest's user avatar
0 votes
0 answers
20 views

How do you log a message if your Event Template expects a map but doesn't receive a map in log4j2?

I want to be able to use Log4j2 to log in JSON format. I am using JsonTemplateLayout and my own Event Template. My application uses MapMessage when logging so I can extract out values for my log ...
osrs10's user avatar
  • 57
0 votes
1 answer
26 views

Log4j2: is it possible to have an implementation of StrLookup recalculate the returned value on each logging event?

I want to use the StrLookup interface to have the current value of a variable printed into each message logged by log4j2. I suppose it should be easiest to do this by inserting it directly into the ...
Sebastian Felix's user avatar
0 votes
0 answers
26 views

Log4j to Log4j2 Migration - GetLoggerRepository

I'm working on a project to migrate legacy Log4j implementation to log4j2 implementation. It is currently using the code as below for getting logger repository. I'm not finding any equivalent for this ...
Venky's user avatar
  • 65
0 votes
2 answers
40 views

The aws sdk java 2.x is printing necessary file contents when log level is set to DEBUG

We have a quarkus application that exposes api endpoint to receive request containing a file and uploads the file to S3 bucket. When application root log level is set to DEBUG and when the request is ...
Bogan's user avatar
  • 1
0 votes
1 answer
37 views

Limit Max Message Size in log4j has no effect

I have read this question Limit max message size in log4j2 pattern. I am using %.-1000mto limit number of characters in my message event. For some reason this has no effect. <?xml version="1....
Rob's user avatar
  • 27
0 votes
1 answer
56 views

How to Modify the MongoDB Document Before Logging in Log4j2 NoSQL MongoDB Appender?

I'm using Log4j2 with the MongoDB NoSQL appender to send logs to a MongoDB database. The appender is working correctly, and the logs are being stored in MongoDB as documents. However, I would like to ...
Tim Lee's user avatar
  • 23
0 votes
1 answer
350 views

Log4j update from 2.23.1 to 2.24.0/1 -> logging gone

I have a big and old legacy project where we updated to log4j 2 very painfully and we use a lot of bridges. <!-- LOGGING --> <dependency> <...
Ande Hofer's user avatar
1 vote
1 answer
41 views

Json formatted messages using Log4j

I'm trying to get log4j to log messages with specific fields in json format. There is a spec the logging has to follow. log_fmt.json { "name": { "$resolver": "map", ...
gph's user avatar
  • 1,311
1 vote
1 answer
55 views

Updating Log4J2 Appender's file path at Runtime

For a project, I have a programm that is started multiple times, and I want to log every run of it into a different File. I already have everything in place I need for this, e.g. a variable holding ...
Sebastian Felix's user avatar
0 votes
1 answer
62 views

Cannot resolve log4j configuration in Android

I am trying to implement log4j in android, using v2.24.1 dependencies in gradle: implementation 'org.apache.logging.log4j:log4j-api:2.24.1' implementation 'org.apache.logging.log4j:log4j-core:2.24.1' ...
nick_j_white's user avatar
1 vote
1 answer
82 views

Dynamically set DEBUG or INFO logging level per request based on request header in reactive Spring Boot with Log4j2

I'm working on a Reactive Spring Boot application that uses Log4j2 as the logging framework. By default, my application logs at the INFO level, and I set the logging level in the application.yml I ...
Rahul verma's user avatar
0 votes
0 answers
76 views

How can I manage logger instances (per class) in my own libraries to allow fine-grained configuration?

I’m using Log4j for logging in a Scala project, where each class creates its logger instance using LoggerFactory.getLogger(this.getClass.getName.stripSuffix("$")). In another project, I ...
N0rb0's user avatar
  • 1
0 votes
0 answers
53 views

Spring Webflux with Log4j2 Memory Issue

I have a spring webflux application with java 17, spring boot 3.3.3 and log4j2 with following JVM configs. -XX:+UseG1GC -XX:+UnlockExperimentalVMOptions -XX:G1HeapRegionSize=1 -XX:G1ReservePercent=10 -...
springbootlearner's user avatar
1 vote
0 answers
61 views

Add caller information with Opentelemetry java agent instrumentation

I have test java app with java agent opentelemetry instrumentation: -javaagent:/usr/src/app/opentelemetry-javaagent.jar -Dotel.instrumentation.log4j-context-data.enabled=true -Dotel.instrumentation....
0 votes
1 answer
35 views

Unable to set my app log level to debug, is my log4j2.properties even being read?

I am trying to initialize log4j2 in my servlet application (apache-tomcat 9). This code private static Logger logger = LogManager.getLogger(MyClass.class) ; ... Enumeration enumerator = LogManager....
Siddharth's user avatar
  • 9,544
0 votes
1 answer
176 views

Log4j Init error : Unable to create Lookup for bundle java.lang.ClassCastException: class org.apache.logging.log4j.core.lookup.ResourceBundleLookup

I am trying to initialize log4j2 in my servlet application (apache-tomcat 9). I am getting a series of exceptions 2024-09-26T07:58:02.478967Z main ERROR Unable to create Lookup for bundle java.lang....
Siddharth's user avatar
  • 9,544
0 votes
0 answers
47 views

Tracing kafka message event in lmax disruptor ring buffer sequence

Below is the code for kafka message consumed and published within lmax disruptor ring buffer, now i need to implement tracing for each event may goes through multiple sequence. Before publishing the ...
STM's user avatar
  • 1
1 vote
2 answers
45 views

log4j2 syslog appender not working in springboot

I'm trying to use log4j2 syslog appender to write messages to syslog from my springboot application. Here is my log4j2.xml <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE ...
manjosh's user avatar
  • 614
0 votes
1 answer
59 views

No factory method found for class HttpAppender

I was trying to use log4j2 HttpAppender, but I get this error: 2024-09-24T07:59:58.504101611Z main ERROR Could not create plugin of type class org.apache.logging.log4j.core.appender.HttpAppender for ...
aldisti's user avatar
  • 45
0 votes
0 answers
35 views

Memory Issue with Logfj Logger

I have a Spring boot webflux application which uses Log4j2 for logging. I am using latest version of Spring Boot starter 3.3.3 and its log4j2. When I did my performance test and its consuming lot of ...
springbootlearner's user avatar
2 votes
1 answer
106 views

Whats the reason for: module not found: org.jspecify

After doing some dependency updates on my project (Java 17 with modules) I got the following error message during compilation: [INFO] --- compiler:3.13.0:testCompile (default-testCompile) @ energy-...
PowerStat's user avatar
  • 3,813
0 votes
0 answers
80 views

Log didin't write into filename that specified in log4j2-spring.xml file

Spring boot version 3.3.3, in my linux system I will have two tomcat instance under /opt, one is called /opt/tomcat (which is the dev environment, specified in conf/catalina.properties with spring....
Vincent Zheng's user avatar
1 vote
1 answer
38 views

how to prevent maven to download an excluded transitive dependency (not exists in dependency:tree output)

I have a project with dependency tree like below. <dependency> <groupId>xxxxx</groupId> <artifactId>xxxxxx</artifactId> <exclusions> <...
green.it's user avatar
  • 220
1 vote
0 answers
21 views

SpringWebflux Log4j2 Memory Issue

I have a spring boot webflux application which calls 5 different backendservices using webclient. We have Log4j2 for logging and using MDC based logging to hold some log lables and attach it to log ...
springbootlearner's user avatar
0 votes
0 answers
67 views

Unable to reduce glue pyspark job log size by changing log level to ERROR

Setup We have multiple data-pipelines reading data from DynamoDB tables, processing it in Glue (pyspark job) and uploading data to Redshift. The glue version is 4.0 Issue Our Cloudwatch bill ...
datawiz879's user avatar
1 vote
0 answers
26 views

Log-entries not color-coded when running tests

The log4j2.xml of this project reads: <?xml version="1.0"?> <Configuration> <Appenders> <Console name="stderr" target="SYSTEM_ERR"> ...
Mikhail T.'s user avatar
  • 3,937
0 votes
0 answers
52 views

Log4j2 does not load custom ConsoleLogConverter and SocketLogResolverFactor plugins

I am trying to add two custom plugins to Log4j2: ConsoleLogConverter and `SocketLogResolverFactory'. However, Log4j2 does not load these plugins when the application is launched, despite the fact that ...
Лев Шаповалов's user avatar
-1 votes
1 answer
79 views

Splitting up the Log Files in Log4j2?

I currently have a "LocalLogger" Class that handles all my logging stuff. I can make a new Object of that class in my other classes, to maintain the same logging all over. Currently the ...
Julian Schaefers's user avatar
1 vote
1 answer
64 views

Unable to add logs from my spark jobs to spark eventlogs

I am trying to output logs in spark event logs so that they are accessible in history server. I have tried two approaches Adding my own custom logger that extends Serializable extending org.apache....
Vikas Saxena's user avatar
  • 1,173
0 votes
0 answers
18 views

Have Solr also log when Lucene performs a segment merge

I'm looking for a way to know when a segment merge happens in Solr. My current approach is via the logs, but JMX would also be fine if that's possible. I've tried adding the following to the log4j2....
KoenDG's user avatar
  • 107
0 votes
1 answer
42 views

Using log4j2 version 2.22.1 , How to add StringWriter as a parameter to Appenders like WriterAppender?

I am migrating from log4j 1.x to 2.x and in 1.x i am using StringWriter from java.io and paasing the parameter to WriterAppender in 1.0 but how to pass the same StringWriter as parameter with latest ...
kiran's user avatar
  • 9
0 votes
0 answers
38 views

How to Prevent Duplicate Logs in Log4j2 Configuration?

I’m working with a Log4j2 XML configuration and I’ve encountered an issue where duplicate logs are being written to the log files. I’m trying to prevent this duplication but am unsure of how to adjust ...
Deendayal Kumawat's user avatar
-1 votes
1 answer
113 views

Log4j2 Logger Class with 2 seperate Log Files

im currently trying to create a LocalLogger Class which i can use in my Project to log stuff. General Idea is: Logs from TRACE to INFO -> infoLog.log Logs from WARN to FATAL -> errorLog.log ALL ...
Julian Schaefers's user avatar
1 vote
1 answer
39 views

pb Logging in db with spring boot 3 and log4j2

I try to save in my db the logs of the console for querying easily on it. It's almost working. Log is ok but I have error log before the end of the spring boot context initialisation. After it's ok. ...
Damian's user avatar
  • 141
-1 votes
1 answer
53 views

log4j2 cannot get any filters to work with consoleappender

Despite various searches showing example usage of a ConsoleAppender that contains filters, I find I get the following error if I put the Filter inside a Filters element inside the ConsoleAppender: ...
Greg's user avatar
  • 601

1
2 3 4 5
91