Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
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
0 votes
2 answers
235 views

Log4j2 No inject constructor error when launching through java.exe

I have a program in java made through maven and packaged with assembly into a single jar with all the dependencies. I need to run this in docker so I need to be able to launch it with java.exe. The ...
Patrik Holub's user avatar
0 votes
2 answers
518 views

Startup log4j2 ERROR Unrecognized conversion specifier and format specifier

In a project using maven, I have the same issue as described in log4j2 ERROR StatusLogger Unrecognized conversion specifier. But the problem persist even after implementing both solutions described in ...
Valentin Ruano's user avatar
-1 votes
1 answer
112 views

Log4j v2 creates logfile but does not write anything to it and ignores my log levels

The problem is that my Log4J logger does not write to a file although it creates it (and the dir too!) and that the levels enabled are only FATAL, ERROR although I told it to enable ALL. Here is my ...
bliako's user avatar
  • 1,113
1 vote
0 answers
469 views

Log4j Additional Logging and Error upgrading from version 2.23.0 to 2.23.1

While upgrading from the dependencies for log4j between version 2.23.0. and 2.23.1 we are encountering additional logging and seeing errors in the log. Additional Trace Logging Log4j2-TF-3-Scheduled-1 ...
bcoveny's user avatar
  • 105
0 votes
0 answers
98 views

Is there a way to color-code Log4J2 in Windows Powershell?

I want to color code my Log4J logs. I tried everything I could, used every answer on Stack Overflow, Google and GPT, and still it doesn't work. This is my log4j2.xml configuration: <?xml version=&...
Eduardo Gottert's user avatar
0 votes
0 answers
181 views

Setting root log level via command line for log4j2

We have a bit old J2EE application that use slf4j and log4j2 for logging. Dependencies looks like below. <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-api&...
Susitha Ravinda Senarath's user avatar
0 votes
1 answer
69 views

Log4j2 - Configuration file getting created but not writing

Java maven war project - when the application starts it should create file and write logs as per log4j2 configuration - here the file is getting created and log4j2 is also taking - but the logs are ...
Bimal S KIRAN's user avatar
2 votes
1 answer
265 views

Maven/Java/Helidon MP: Log4j2.xml <JSONLayout> causing conflict with custom annotation processor

I have a multi module maven project. Module A has an annotation processor, and Module B has a dependency on module A in its pom.xml. Module B also has a src/main/resources/META-INF/services/javax....
swing1234's user avatar
  • 233
1 vote
1 answer
599 views

SLF4J2 and Log4J1 to Log4J2

I have been scratching my head over logger dependencies. I want my own code to use the SLF4J 2 API and in tests and runtime use Log4J2 as the provider. However, I have a dependency on OpenLr's binary ...
Ivan Webber's user avatar
2 votes
1 answer
491 views

Getting Error - "ERROR StatusLogger Log4j2" if I do "Run as Java Application"

Getting the below error if I run my test/java class using "Run as Java Application" - "ERROR StatusLogger Log4j2 could not find a logging implementation. Please add log4j-core to the ...
Shreyas Lembhe's user avatar
1 vote
1 answer
338 views

Migrate from Log4j2 to Logback not working using OpenRewrite recipe

Following the instructions on https://docs.openrewrite.org/recipes/java/logging/logback/log4jtologback I've added the plugin and dependencies to my pom.xml. I had to exclude many artifacts because of ...
Kees de Bruin's user avatar
0 votes
2 answers
3k views

Log4j2 attemts to load a class that no longer exists

I am building a Java application using Maven. I recently added Log4j2 libraries (log4j-api and log4j-core) to the dependencies in my pom.xml file. This enables me to perform decent logging on my ...
Factor Three's user avatar
  • 2,244
0 votes
0 answers
1k views

Log4J ERROR StatusLogger Unrecognized conversion specifier

I am getting the following errors on deployment of my JAR file. ERROR StatusLogger Unrecognized conversion specifier [thread] starting at position 25 in conversion pattern. ERROR StatusLogger ...
ExceptionExplorer's user avatar
0 votes
2 answers
982 views

Problem with log4j2 to write all logs to a specific file in Spring Boot 3.1.0 with Maven

I am trying to set log4j2 to write all logs to a specific file. I've tried various things I found on the internet but still the logs only show up in the console. I am using IntelliJ IDEA CE. Spring ...
akicay's user avatar
  • 33
0 votes
1 answer
347 views

Log4j2 Error appears as Fatal message when following a tutorial

I am trying to follow the below tutorial to add Log4j2 logging to my Spring application. https://www.dataset.com/blog/maven-log4j2-project/ When testing out Log4j2 in application, the FATAL level log ...
kenbinner's user avatar
0 votes
1 answer
197 views

Log4j2 does not log to file when test project is executed using Maven (mvn clean test)

When running using mvn clean test from IntelliJ terminal, Log4j2 does not write to the log file. But when tests are run using TestNG play button inside IntelliJ, logs are getting written. This ...
Glenn P's user avatar
  • 37
0 votes
0 answers
2k views

Log4j appender plugin "ERROR StatusLogger Unrecognized format specifier" when run from an executable jar

I am using IntelliJ IDEA and Maven. I am making a server application in JavaFX and wanted to use Log4j to display logs in the server console. When compiling the program in the IDE, everything works as ...
BSP0's user avatar
  • 1
4 votes
2 answers
4k views

Log4J2 dynamic appender doesn't work with maven-shade-plugin

I add an appender programmatically. It was working until I added maven-shade-plugin. I wonder what makes my appender fail. The appender works ✅ or not ❌ in these scenarios: ✅ From IDE (IntelliJ IDEA) ...
Ferran Maylinch's user avatar
0 votes
2 answers
5k views

Console contains an invalid element or attribute "JsonTemplateLayout" even after adding dependency

Below is my log4j.xml <?xml version="1.0" encoding="UTF-8"?> <Configuration> <Appenders> <Console name="JsonAppender" target="...
Vaibhav Dhore's user avatar
0 votes
1 answer
1k views

log4j (2.20.0) takes several seconds to initialize

I have added log4j 2.20.0 to a Maven project. The problem is that calling LogManager.getLogger(Main.class) takes several seconds to complete. About six seconds. Everywhere I look the preferred way to ...
mammut's user avatar
  • 11
1 vote
0 answers
543 views

when i use the Log4j 1.x bridge (log4j-1.2-api),but Caused by: java.lang.ClassNotFoundException: org.slf4j.impl.Log4jLoggerAdapter

log4j2 performs better, but the jar in my dependencies uses log4j, which causes warnings. Because it depends on slf4j-log4j12. So I follow documents: https://logging.apache.org/log4j/2.x/manual/...
pieere yu's user avatar
0 votes
1 answer
434 views

Multiple Slf4j bindings unable to add log4j2 spring boot

In my project have multiple slf4j bindings [INFO] +- org.springframework.boot:spring-boot-starter-data-jpa:jar:3.0.2:compile [INFO] | +- org.springframework.boot:spring-boot-starter-aop:jar:3.0.2:...
xMayank's user avatar
  • 1,995
3 votes
1 answer
1k views

How to disable Log4j configuration from external Maven dependency?

I have Spring Boot application with Log4j2 XML configuration file placed in resources/log4j2.xml. One external library I use is installed via Maven dependency and have own logging configuration in ...
jnemecz's user avatar
  • 3,578
0 votes
1 answer
772 views

Maven: Log4j class not found

I have a project for which I've added an optional dependency to Log4j: <dependency> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j-core</...
Rob Spoor's user avatar
  • 8,985
1 vote
0 answers
288 views

log4j // log24j // unrecognized format specifier

I have upgraded from slf4j 2.8.2 to sl4j 2.17.2 and now see this error: ERROR StatusLogger Unrecognized format specifier [d] ERROR StatusLogger Unrecognized conversion specifier [d] starting at ...
dough_daddy's user avatar
0 votes
2 answers
834 views

Log4j2 does not write logs to console or file (properties)

i tried to add log4j2 to my project, and i want it to write logs to the file and to the console, but no one works... My log4j2.properties file appenders = myfileappender,console appender....
Богдан Иманкулов's user avatar
0 votes
0 answers
124 views

Log4j2 configuration broken on ubuntu 20.04 (Getting garbled logs)

log4j2 configuration was working fine on ubuntu 14 but start getting garbled logs when I deployed application on ubuntu 20.04 machines. I am using following log4j2.xml file configuration and ...
Abhishek's user avatar
  • 379
1 vote
1 answer
2k views

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....
007_programmer's user avatar
0 votes
1 answer
413 views

Multiple issues in Log4J Upgrade for old Java Servlet ( Struts ) based application

Current Situation Java Application development version: a Struts based GUI application developed in Java 1.5 JDK used for Compilation: 1.7 Tomcat Server: Application is hosted on tomcat 6. Current ...
Hitesh Tambe's user avatar
0 votes
1 answer
401 views

how to add log4j2 file multi maven project

I am working on Multi Maven Project which has structure like below - TestRepo (Maine Project) -APITests -Shared libraries -FrontendTests Now Shared Libraries is common to both API Tests ...
Ashu123's user avatar
  • 352
0 votes
0 answers
569 views

Unable to test multiple logEvent message in unit tests in Log4j2

I am having log4j2 with slf4j but getting same log message. Provided the sample code. Getting Mutable Log Event in Argument Capture Log Event object. Count is giving correct but same message gets ...
Abhishek's user avatar
  • 379
0 votes
1 answer
834 views

Why are log4j classes loaded by two class loaders?

I have a maven project for an application, which I run in a WildFly server. The project has log4j dependencies: <dependency> <groupId>org.apache.logging.log4j</groupId> <...
vecta's user avatar
  • 43
0 votes
0 answers
341 views

JBoss issues while porting apps from Log4J to Log4J2

I've ported from Log4J to Log4J2 some applications that run in a servergroup under JBoss 7.1.0 control. The new applications are all correctly built by maven, but when I deploy some of them on the ...
SJB's user avatar
  • 95
1 vote
1 answer
2k views

log4j2.xml is not getting called in Docker container

I am using java maven web application, i have added log4j2.xml file to the classpath in STS manually then the logging is working fine. But i am deploying the war file to ECS docker container, there ...
Shajitha Begum K's user avatar
1 vote
1 answer
2k views

Migrating from log4j to log4j2

I am migrating from log4j1.x to log4j2 due to recent vulnerability. It seems another dependency is referencing the the old log4j1.x file. In addition to removing old log4j1.x file I added log4j-core, ...
jms310's user avatar
  • 13
0 votes
1 answer
2k views

LoggerContext import fails for log4j 2.17.1 in spite of adding Maven dependency

I am trying to use LoggerContext in my Java code. Added the Maven dependency in pom.xml: <dependency> <groupId>org.apache.logging.log4j</groupId> <artifactId>...
AutoTester999's user avatar
1 vote
1 answer
1k views

Unable to configure log4j2 for logging in Maven project on VS Code

I have added the dependencies in pom.xml: log4j-api (2.17.0) and log4j-core (2.17.0). Java version on Windows 10 is "17.0.1" 2021-10-19 LTS I have put the file log4j2.yml is src/main/...
coder.in.me's user avatar
  • 1,068
1 vote
0 answers
3k views

common.logging not printing log messages after upgrade to log4j 2.17

I upgraded log4j from 1.x to 2.17 successfully but there is no log messages printing. I debug and found org.apache.commons.logging (already exist in .java files) is not printing any log messages but ...
Hitesh Kumar's user avatar
2 votes
0 answers
2k views

log4j.LogManager.callerClass crashed on JRE 11 and 16 except JRE 8

In order to solve the security vulnerability, I have updated Log4j from 2.8.1 into 2.17.0 on pom.xml of Maven as below, building with Java 8. <dependency> <groupId>...
Haru's user avatar
  • 91
2 votes
1 answer
270 views

How to use one log4j2 configuration file for runtime in IDE and another log4j2 configuration file for packaging/deployment?

Using Eclipse 06-2021, Maven, log4j2. I am using log4j2 framework for logging in my application. I created configuration in resources folder in a log4j2.properties file. I defined there some loggers ...
Wortig's user avatar
  • 1,158
1 vote
1 answer
647 views

Keep 30 archived log files in Log4j 2.x Core

I want to configure log4j2.properties file in a that way where my swapi.log entries delete all previous logs written, for example if we want to delete log entry for upto 30 entries, once it reaches to ...
Manu's user avatar
  • 15
1 vote
1 answer
252 views

Log4j disabling scan @webservices

We are trying to user log4j2 ( moving from log4j1 ) but have an issue probably related to the classpath but I couldN,t fix it after multiple tries We are using a separate module (NbfgLogging) that use ...
Daniel Jans's user avatar
-2 votes
1 answer
8k views

how to identify log4j2 or log4j in maven project?

We are using maven project and need to check we are using log4j or log4j2 in the java application . Please guide me the best practice below is my pom.xml <properties> <!-- Avoid warnings ...
kiran chand kothuru's user avatar
2 votes
1 answer
609 views

Is it a standard practice to explicitly exclude dependencies?

for example, in my pom.xml <dependency> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j-api</artifactId> <version>2.15.0&...
xcoder's user avatar
  • 1,436
2 votes
2 answers
4k views

Spring boot not loading log4j2.xml

I'm trying to add log4j2 framework inside my spring boot application, and I'm using spring AOP to isolate logging concern apart from my logic business. Unfortunately when I try to log my messages, ...
mr.Penguin's user avatar
  • 1,579
0 votes
0 answers
2k views

Logging with Log4j2 in Java Servlets running on Tomcat

I have done some web programming in other languages but I am new to Tomcat, Servlet, Log4j, and Maven. I completed my first ever Servlet by following this tutorial: The next thing I tried was to add ...
Sanlok Lee's user avatar
  • 3,494
7 votes
0 answers
2k views

Problems with log4j2 > 2.12 and maven assembly

I have created a simple java application to debug my problem but i am still blocked. I create a jar with maven assembly but i have this error at startup: D:\Workspace_java11\testlog4j\target>java -...
Nicolas's user avatar
  • 161
0 votes
1 answer
627 views

Getting JUL to log via log4j2 while using Maven in JUnit tests

I'm running a little test project where I want my JUL logs to be redirected and appear as log4j2 logs. I'm using the following Maven dependencies: <dependency> <groupId>org.junit....
user35359's user avatar
  • 253
0 votes
0 answers
619 views

Getting error while building project using log4j2 in spring boot

I am using maven to build spring boot project using log4j2. But whenever i run mvn spring-boot:run i get a error like, ERROR Unable to create file /apps/events/logs/event.csv Could not create ...
Rajat Aggarwal's user avatar