Questions tagged [slf4j-api]

53 questions
2
votes
2 answers

Slf4j custom provider implementation not being picked up

Slf4j provides libraries to "fool" backend specific codebase into thinking specific backend exists while redirecting all the logging to one slf4j api compatible backend. In short log4j-over-sl4j will redirect anything from log4j specific logging…
vach
  • 10,571
  • 12
  • 68
  • 106
2
votes
0 answers

slf4j-ext NDC PatternLayout

NDC (Nested Diagnostic Context) in: org.slf4j slf4j-ext is implemented using the org.slf4j.MDC. While…
Marcin
  • 21
  • 4
2
votes
2 answers

Logging configuration in Spring Boot

Looking the way how to configure slf4j in Spring boot app: I add this in my application.properties: logging.level.org.springframework.web=DEBUG logging.file=book.log logging.level.*=DEBUG I have this controller: import org.slf4j.Logger; import…
en Lopes
  • 1,863
  • 11
  • 48
  • 90
1
vote
2 answers

Does Log4j2 and SLF4J MDC get along?

Using Finatra, I'm trying to activate traceID logging, but nothing ends up in Log4J2 output. Finatra supports SLF4J MDC. SLF4J MDC is supposed to support Log4J (2?). Log4J2 is supposed to support MDC and SLF4J. But in the end, the MDC data is always…
brisssou
  • 499
  • 6
  • 12
1
vote
0 answers

Is there an Alternative to org.slf4j.Logger.addAppender()

I'm updating an old project to use the latest version of the following dependencies: compile 'ch.qos.logback:logback-core:1.4.4' compile 'ch.qos.logback:logback-classic:1.4.4' compile 'ch.qos.logback:logback-access:1.4.4' compile…
Mohammad Najar
  • 2,009
  • 2
  • 21
  • 31
1
vote
0 answers

How can I keep simplelogger.properties used by SLF4j SimpleLogger file at some system path rather keeping it in classpath?

Is it possible to put simplelogger.properties used by SLF4j SimpleLogger file at some system path rather keeping it in classpath i.e. src/main/resources? I have gone through the SLF4j SimpleLogger documentation but couldn't find any reference to my…
Jaraws
  • 581
  • 1
  • 7
  • 24
1
vote
1 answer

Java azure-messaging-servicebus - turn off logs

I am using following library to connect to my Azure Service Bus through Java application com.azure azure-messaging-servicebus 7.2.1 I am able to…
1
vote
1 answer

SLF4J put and immediate get is failing

I've written a little wrapper for SLF4J MDC. import org.slf4j.MDC; import java.util.UUID; public final class MdcWrapperUtility { public static final String MDC_TRANSACTION_ID_KEY_NAME = "MDC_TRANSACTION_ID"; private…
granadaCoder
  • 26,328
  • 10
  • 113
  • 146
1
vote
1 answer

How Can I Add Console Appender In Logger Object Using log4j-over-slf4j Dependency?

I can't be able to add console appender using logger.addAppender method with log4j-over-slf4j 1.7.x dependency. Moreover, I am unable to set target of that particular Console Appender(i.e., SYSTEM_OUT/SYSTEM_ERR). I have initialized a console…
Ritesh_RM
  • 13
  • 6
1
vote
0 answers

Log42 json logging using slf4j API

I am trying figure out JSON logging using log4j2 as documented in https://logging.apache.org/log4j/2.x/manual/layouts.html#JSONLayout All works fine except when I am trying to log an object as json by setting objectMessageAsJsonObject=true using…
Arajit
  • 133
  • 3
  • 15
1
vote
3 answers

How to get slf4j console output when no implementation is present?

We have many "parent" (or "library") projects. They only have the slf4j-api in the classpath, but no implementation like logback. I often want to write a quick temporary main method to test something, and get SLF4J: Failed to load class…
Reto Höhener
  • 5,419
  • 4
  • 39
  • 79
1
vote
0 answers

slf4j logging not printing in server.log file instead it is printing on console - wildfly

I have satndalone.xml with logging config, and pom.xml with slf4j dependency configured. Using lombok.extern.slf4j.Slf4j api annotations(@Slf4j) for logging in java classes. The issue is the logs using this Slf4j are printing on console but not…
ddc
  • 885
  • 6
  • 12
1
vote
1 answer

How do I restrict the stacktrace display on logs?

I'm using logback 1.1.3 over slf4j-api 1.7.7. I'm reading the following documentation here. The code (which I can't modify) that I'm trying to restrict the logging logs and throws exceptions in the following way. try {.. } catch( Exception e ) { …
supertonsky
  • 2,563
  • 6
  • 38
  • 68
1
vote
1 answer

How to Override method name in Logback logging?

I am trying to implement a logging concept with AOP but while printing the log I need give my own method name instead of the default. Update (based on the comments from @glitch): I am using the %M conversion specifier to tell Logback to include the…
Ashok Kumar N
  • 573
  • 6
  • 23
1
vote
0 answers

SBT project Depedencies

I have a sbt project. It has many dependencies defined in the build.sbt file. So recently when i start my application i am seeing that it is automatically downloading the latest alpha version of slf4j-api which is…
Sidhant
  • 421
  • 1
  • 6
  • 17