Questions tagged [slf4j]

Simple Logging Facade for Java (SLF4J) serves as a simple facade or abstraction layer for various logging frameworks. Please also include a tag for the actual logging framework you're using if you are attempting to configure logging for your application.

The Simple Logging Facade for Java (commonly known as "SLF4J") serves as a simple facade or abstraction layer for various logging frameworks, e.g. java.util.logging, log4j and logback.

One can unify all logging across an application and the libraries it uses via this abstraction layer. Code familiar with SLF4J uses the SLF4J API directly for logging. Any existing code or libraries that use some other logging framework can be bridged to get their logging redirected to SLF4J instead. The end application at deployment time includes a binding to the actual logging framework that they are using, and can configure that logging framework as desired for all logging throughout the application.

References:

3285 questions
1
vote
0 answers

logs not getting generated by LoggerFactory

I am using slf4j for generating logs and using Loggerfactory class. Here is my code @Override public void afterScenario(ScenarioResult result, ScenarioContext context) { LoggerFactory.getLogger(getClass()).info("The Result of…
Hardik Rana
  • 476
  • 1
  • 6
  • 16
1
vote
2 answers

SLFJ logs not getting generated

I am new to slf4j, In my Project I am using it for getting Logs. I am using InteliJ IDE. Here is my code package com.sample; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class TestMainclass { static Logger logger =…
Hardik Rana
  • 476
  • 1
  • 6
  • 16
1
vote
1 answer

Sfl4j and java 8: The target type of this expression must be a functional interface

I have a very expensive operation to generate a debug message and I want to avoid for it to be generated each time. So I use this: log.debug("{}", () -> expensive()); //gives the target type must be a functional interface I defined: private String…
Phate
  • 6,066
  • 15
  • 73
  • 138
1
vote
1 answer

Why a SLF4J mark is seen even though was removed

I used SLF4J in my project but I removed all dependencies from my maven project because I do not need that. Unfortunatelly when I run my project I see this below. I do not see any handle to SLF4J in my project. Could you tell me why I see that?…
user3740179
  • 133
  • 10
1
vote
1 answer

Logging to an external file using Apache Camel

I have a Camel Route which consumes a CSV file, converts it to XML and streams the data to ActiveMQ topic. I just want to log messages from my Camel Route, also detail log message about processing a message, etc. Code: public void configure()…
sidd
  • 195
  • 3
  • 20
1
vote
1 answer

conflicting files on the build path

After compiling my java code under Eclipse, I got the following error messages: SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in…
bit-question
  • 3,733
  • 17
  • 50
  • 63
1
vote
2 answers

How to mask the userName and password in requestBody logs

Below is my request body xml and I am making rest call with this request. Having custom LoggingInterceptor to log the request and response. I want to mask the user and password in logs.
Remo
  • 534
  • 7
  • 26
1
vote
1 answer

slf4j logback log rolling creating .tmp file

I have a issue where sometime log rolling creating a .tmp file and does not create the original log file back. interesting I noticed this happens when rolling of logs start 1 min before the midnight. 1.7.15 my logback.xml configuration is as below …
1
vote
1 answer

Spring Boot | Change slf4j file path programmatically

I need to programmatically set the file path of a Spring Boot application based on a parameter. Currently the log file path is set via the Spring Boot property logging.file. I need to programmatically override this property. The other log…
André
  • 464
  • 4
  • 17
1
vote
1 answer

SLF4J: Class path contains multiple SLF4J bindings Spring Maven

After adding apache.mahout to my pom.xml I started to have this warning when i run my spring project and i want to know how supress this warning. SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in…
Kapio
  • 29
  • 3
  • 8
1
vote
0 answers

Spring Lombok Slf4j multiple log files based on log level

I'm developing a Spring Boot Backend Service. For logging I'm currently using Lombok with Slf4j and Logback. Now i would like to log to different files based on the log level. I know how to do this with a custom logback (XML) configuration and…
Jakob Benz
  • 127
  • 1
  • 14
1
vote
2 answers

How many projects use Async Logger in log4j2?

Async loggers in log4j2 can improve the logging performance a lot, but are they robust enough? When programs are killed unexpectedly, will the logging messages before that time point be flushed into disk? And does anyone know how many big…
jl0x61
  • 407
  • 3
  • 12
1
vote
0 answers

Encode all logs in Slf4j

Is there any good way to custom logging to Slf4j I wanted to ESAPI encode all logs before printing to console.Is there any better way to do it. currently I use log.info("This is my log {}", id); is it possible to achieve with out using…
Patan
  • 17,073
  • 36
  • 124
  • 198
1
vote
1 answer

JAVA: Getting pause in application when Log file is going to roll over

I am using wildfly 9 and slf4j(slf4j-api-1.7.21.jar)/log4j(log4j-1.2.17.jar). I am getting a pause in the application when the file is going to roll-over. My logging configuration in standalone.xml is below:
1
vote
1 answer

java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory in OSGi

I'm trying to get the library BioJava to work inside an OSGi context. To get the JAR into the OSGi context, I'm using the Maven plugin p2-maven-plugin, which generates a file Manifest.MF, and the part relevant to the exception I'm facing…
Stefan S.
  • 3,950
  • 5
  • 25
  • 77
1 2 3
99
100