Skip to main content
Filter by
Sorted by
Tagged with
1011 votes
40 answers
1.9m views

My application is to be deployed on both tcServer and WebSphere 6.1. This application uses ehCache and so requires slf4j as a dependency. As a result I've added the slf4j-api.jar (1.6) jar to my war ...
DJ180's user avatar
  • 20k
322 votes
3 answers
267k views

What is the correct approach to log both a populated message and a stack trace of the exception? logger.error( "\ncontext info one two three: {} {} {}\n", new Object[] {"1",...
rowe's user avatar
  • 3,221
225 votes
5 answers
305k views

api 1.7 and slf4j-simple as implementation. I just can't find how to configure the logging level with this combination. Can anyone help out?
Gelin Luo's user avatar
  • 14.4k
206 votes
7 answers
137k views

In our software we extensively use MDC to track things like session IDs and user names for web requests. This works fine while running in the original thread. However, there's a lot of things that ...
Lóránt Pintér's user avatar
197 votes
4 answers
130k views

I am not able to decide whether to use slf4j or not with log4j2. Based on online posts, does not look like it will have any performance hit but is it really required. Also these points rule in favor ...
Andy897's user avatar
  • 7,173
173 votes
13 answers
174k views

Is it possible to somehow intercept the logging (SLF4J + logback) and get an InputStream (or something else that is readable) via a JUnit test case...?
carlspring's user avatar
  • 32.9k
163 votes
1 answer
112k views

The first time I heard about markers was while reading: http://slf4j.org/faq.html I checked available methods for the Logger object: http://www.slf4j.org/api/org/slf4j/Logger.html http://logging....
gavenkoa's user avatar
  • 49.6k
145 votes
5 answers
97k views

I am little bit confused by these three logger libraries. It seems like that they can do the similar thing in Java logging...
Ev3rlasting's user avatar
  • 2,615
125 votes
11 answers
71k views

Hibernate 3.x used slf4j for logging. Hibernate 4.x uses jboss-logging. I am writing a standalone application which uses Hibernate 4, and SLF4J for logging. How can i configure Hibernate to log to ...
Tom Anderson's user avatar
  • 47.4k
121 votes
2 answers
86k views

What's the correct approach to log both an error message and an exception using SLF4J? I've tried doing this but the exception stack trace is never printed: logger.error("Unable to parse data {}", ...
pjp's user avatar
  • 17.8k
110 votes
3 answers
111k views

I'm building a small Java app and hoping to use logback for logging. My app has a dependency on an older project that does its logging via org.apache.commons | com.springsource.org.apache.commons....
Carl Smotricz's user avatar
92 votes
19 answers
117k views

I'm using slf4j and I want to unit test my code to make sure that warn/error log messages are generated under certain conditions. I'd rather these be strict unit tests, so I'd prefer not to have to ...
Javid Jamae's user avatar
  • 9,057
81 votes
26 answers
143k views

I use Spring Boot and want it to write log output to a file. According to the docs, this is simply done by setting logging.file=filename.log While the console output works fine, filename.log is not ...
Christoph Möbius's user avatar
80 votes
5 answers
189k views

I have the followed imports: import org.slf4j.Logger; import org.slf4j.LoggerFactory; and the following instantiation: private static Logger logger = LoggerFactory.getLogger(Test.class); and the ...
user2763361's user avatar
  • 3,919
74 votes
10 answers
155k views

How to globally enable debug for all the slf4j.Logger objects?
missingfaktor's user avatar
66 votes
3 answers
53k views

Im using slf4j for tracing the information. My code is private static final Logger log = LoggerFactory.getLogger(ObjectTest.class); log.trace("Time taken to store " + count + " objects ...
diya's user avatar
  • 7,178
60 votes
5 answers
70k views

Currently I am working with a Spring Cache and the @Cacheable/@CacheEvict annotations. I would like to get some sort of a console log statement like "INFO: i got those values from the cache, NOT from ...
BassSultan's user avatar
60 votes
5 answers
13k views

I am using slf4j for logging in my application. I get the purpose of slf4j. I would like to know how to find out which logging-library slf4j is currently binding to. I have log4j in my referenced ...
psykeron's user avatar
  • 826
59 votes
10 answers
212k views

I am trying to run GWT RequestFactory and facing this error: ClassNotFoundException: org.slf4j.LoggerFactory I have tried to download slf4j-api-1.3.1.jar but it didnt resolve the issue Any idea ...
junaidp's user avatar
  • 11.3k
58 votes
3 answers
39k views

My question seems to be easily answerable, but there are several good solutions. I like to choose the 'best' one. Available frameworks (feel free to suggest more): Androlog SLF4J Android Log4J - ...
Marcell's user avatar
  • 961
56 votes
2 answers
40k views

I'm happily using SLF4J with Logback and use 2 appenders for the ROOT logger as follows: <root level="DEBUG"> <appender-ref ref="STDOUT" /> <appender-ref ref=...
Dimitri Dewaele's user avatar
54 votes
6 answers
205k views

I'm trying to run the sample tiles example given here. Below is my POM.xml: <dependencies> <dependency> <groupId>junit</groupId> <...
javanoob's user avatar
  • 6,462
52 votes
4 answers
49k views

My scala/sbt project uses grizzled-slf4j and logback. A third-party dependency uses Apache Commons Logging. With Java/Maven, I would use jcl-over-slf4j and logback-classic so that I can use logback ...
wks's user avatar
  • 1,148
49 votes
6 answers
21k views

It seems that log4j has some class loading issues (among others) and it seems to me the trend is to move out of log4j toward slf4j. (Hibernate stopped using the first in favor of the latter) Is it ...
ruchirhhi's user avatar
  • 609
48 votes
11 answers
87k views

I've read tons of posts and documents (on this site and elsewhere) pointing that the recommended pattern for SFL4J logging is: public class MyClass { final static Logger logger = LoggerFactory....
danirod's user avatar
  • 1,021

1
2 3 4 5
69