3,401 questions
2
votes
1
answer
44
views
How to workaround slf4j reading disk on main thread in Android?
I do have the following line in my Android app:
private Logger logger = LoggerFactory.getLogger(getClass().getSimpleName());
When testing for threads access in strict mode i found the following issue ...
0
votes
0
answers
30
views
Sse subscription method with a specific parameter is not logged
I have an application using Java 11, Spring, Apache CXF 3.4.2, Tomcat and slf4j. The method that serves as the endpoint for subscribing to server-sent events doesn't log any errors. They're visible in ...
3
votes
0
answers
78
views
How to set different log level for different appenders without filters in logback-spring.xml file?
In Spring Boot application for logs made with Slf4j I want to show INFO level logs in console and DEBUG level logs in file. I also want to change level logs in console with Actuator, so I can't use ...
0
votes
0
answers
19
views
How to use SLF4J 2.0 with Apache Ant
I have to refactor a custom ant task to use a rewritten implementation of the code.
As part of the rewrite, the logging library was updated from slf4j 1.7.26 to 2.0.17, using logback 1.5.28, updated ...
5
votes
1
answer
136
views
Is it possible to route Logback logging to SLF4J in a Log4j2-based project
My project uses SLF4J with Log4j2, but recently I introduced a dependency that uses Logback for logging and DOES NOT use SLF4J. The dependency's code includes the following import:
import ch.qos....
2
votes
1
answer
144
views
How to load SLF4J-API and Password4j in Oracle 23ai free?
Password4j 1.8.2 cannot be loaded under Oracle 23ai free because most of the time ora-29532 java call terminated by uncaught java exception java.lang.noclassdeffounderror org/slf4j/loggerfactory ...
0
votes
1
answer
109
views
Logback rolling based on file size not working
I use logback-classic in version 1.5.18 with slf4j 2.0.16
Here i have done a basic name for reproducing the issue (rolling doesn't work)
public class LogRotationTest {
public static void main(...
0
votes
1
answer
65
views
Spring boot append structured json log with a new property
My application is using structured json logging and log4j. My goal is to add a new field to json log if a specific throwable is passed into log method as an argument
With mdc this is easy
} catch (...
0
votes
1
answer
53
views
Measuring Logging performance
I am trying to measure logging performance in combination with in unit test. What I noticed is, the first block that gets executed gets some overhead get added. The code below is one case with ...
0
votes
1
answer
108
views
Force Jetty Maven Plugin to use SLF4J instead of JUL for Jetty's logs?
Using Maven 3:
jetty maven plugin - version 11.0.24,
logback classic - version 1.4.14,
jul-to-slf4j version 2.0.16 :
public class MyLifecycleListener implements ServletContextListener {
@Override
...
0
votes
1
answer
85
views
In Scala script, avoid "Failed to load class org.slf4j.impl.StaticLoggerBinder"
When running my Scala script, I'm seeing a warning:
> scala upload.scala
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger ...
0
votes
1
answer
105
views
Logging not working with sl4j annotation even if it is in my dependency tree
I am working on a small project with spring boot and the logging seems to not work.
I receive this:
2025-03-02 13:44:41 [JDALogger] [WARN] Using fallback logger due to missing SLF4J implementation.
...
0
votes
0
answers
99
views
Slf4j with Logback breaks when moving from Groovy 2.5.23 to Groovy 4.0.25
I have the following Logging.groovy
import ch.qos.logback.classic.Level
import ch.qos.logback.classic.LoggerContext
import ch.qos.logback.classic.encoder.PatternLayoutEncoder
import ch.qos.logback....
0
votes
1
answer
344
views
Why am I getting "No SLF4J Providers found" in my Scala + AKKA Jar?
I have a JAR that I built using the assembly plugin for sbt.
When I run the code through the IDE, I can see the logs produced by my actors, alongside the logs from Hibernate.
When I run the jar on the ...
0
votes
0
answers
88
views
Logback is not filtering log levels to the Console output as expected
The goal is:
Write only desired log level to the Console output by JVM args (-Dlog.level=DEBUG) (default INFO). (Not working)
Write DEBUG level to ROLLING_FILE_DEBUG file appender. (Working fine)
...
0
votes
1
answer
115
views
Facing issue - java.lang.ClassCastException: class org.slf4j.helpers.NOPLoggerFactory cannot be cast to class ch.qos.logback.classic.LoggerContext
I am trying upgrade eclipse 4.23 to eclipse 4.31.
while doing this I am facing this issue.
I am using slf4j and logback version,
ch.qos.logback.classic_1.5.0.jar
ch.qos.logback.core_1.5.0.jar
slf4j....
1
vote
1
answer
136
views
SLF4J doesn't find provider from logback-classic on vertx
I'm trying to add Logback on a Vertx project, but it seems SLF4J can't see logback even if itself come from a logback dependency. I used maven dependency logback-classic, which transitively imports ...
0
votes
1
answer
74
views
Setting logback filter generates exception
I've been trying to set an logback filter in my Eclipse Equinox RT application as follows:
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<configuration ...
0
votes
0
answers
24
views
What is the slf4j equivalent of logger.getAppender? [duplicate]
I'm trying to change a codebase from using log4j to slf4j. We have a log4j.xml with appenders like this
<appender name="DefaultAppender" class="org.apache.log4j.ConsoleAppender&...
1
vote
2
answers
1k
views
How can I prevent duplicate log messages using Log4j and SLF4J in a Java application?
I'm working on a Java application that uses SLF4J for logging and Log4j for the underlying logging implementation. The application frequently logs repetitive messages in quick succession, leading to ...
1
vote
1
answer
346
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 ...
1
vote
1
answer
560
views
What is the way to send structured log fields with log4j?
With slf4j I can do as follows:
logger.atInfo()
.setMessage("My message")
.addKeyValue("foo", "bar")
.addKeyValue("code", 42)
.log()
Which, when used ...
0
votes
1
answer
574
views
How to pass MDC data from main thread to webserver http threads
I'm using Spring Boot and MDC to log additional context with each log entry in my REST API application. I use MDC in the main thread, but the data is not passed to the http threads that are created ...
0
votes
2
answers
70
views
Why does dnsjava requires slf4j and logback?
So I'm (trying) developing a kotlin console application, where the user can sign up with an email, and in order to validate this email I use dnsjava library, but that requires me to use the slf4j and ...
0
votes
1
answer
781
views
Catch all ERROR level logs to count them with Micrometer
I am integrating my Spring Boot application with Micrometer (and Prometheus and Grafana).
I would like to have a Micrometer counter that collects and shows me info (when the exception appeared) about ...