Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (102)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (322)
Collections:
Other Resources:
SLF4J API Source Code
SLF4J API is a simple API that allows to plug in any desired logging library
at deployment time.
Here is the source code for SLF4J API 2.0.4. You can download its pre-compiled version slf4j-api-2.0.4.jar at SLF4J Download Website.
✍: FYIcenter.com
⏎ org/slf4j/event/EventRecordingLogger.java
package org.slf4j.event;
import java.util.Queue;
import org.slf4j.Marker;
import org.slf4j.helpers.LegacyAbstractLogger;
import org.slf4j.helpers.SubstituteLogger;
/**
*
* This class is used to record events during the initialization phase of the
* underlying logging framework. It is called by {@link SubstituteLogger}.
*
*
* @author Ceki Gülcü
* @author Wessel van Norel
*
*/
public class EventRecordingLogger extends LegacyAbstractLogger {
private static final long serialVersionUID = -176083308134819629L;
String name;
SubstituteLogger logger;
Queue<SubstituteLoggingEvent> eventQueue;
// as an event recording logger we have no choice but to record all events
final static boolean RECORD_ALL_EVENTS = true;
public EventRecordingLogger(SubstituteLogger logger, Queue<SubstituteLoggingEvent> eventQueue) {
this.logger = logger;
this.name = logger.getName();
this.eventQueue = eventQueue;
}
public String getName() {
return name;
}
public boolean isTraceEnabled() {
return RECORD_ALL_EVENTS;
}
public boolean isDebugEnabled() {
return RECORD_ALL_EVENTS;
}
public boolean isInfoEnabled() {
return RECORD_ALL_EVENTS;
}
public boolean isWarnEnabled() {
return RECORD_ALL_EVENTS;
}
public boolean isErrorEnabled() {
return RECORD_ALL_EVENTS;
}
// WARNING: this method assumes that any throwable is properly extracted
protected void handleNormalizedLoggingCall(Level level, Marker marker, String msg, Object[] args, Throwable throwable) {
SubstituteLoggingEvent loggingEvent = new SubstituteLoggingEvent();
loggingEvent.setTimeStamp(System.currentTimeMillis());
loggingEvent.setLevel(level);
loggingEvent.setLogger(logger);
loggingEvent.setLoggerName(name);
if (marker != null) {
loggingEvent.addMarker(marker);
}
loggingEvent.setMessage(msg);
loggingEvent.setThreadName(Thread.currentThread().getName());
loggingEvent.setArgumentArray(args);
loggingEvent.setThrowable(throwable);
eventQueue.add(loggingEvent);
}
@Override
protected String getFullyQualifiedCallerName() {
return null;
}
}
⏎ org/slf4j/event/EventRecordingLogger.java
Or download all of them as a single archive file:
File name: slf4j-api-2.0.4-sources.jar File size: 70304 bytes Release date: 2022-11-17 Download
⇒ Source Code for SLF4J Simple Logging
⇐ Downloading SLF4J Components
2020-02-13, ≈41🔥, 2💬
Popular Posts:
JDK 11 jdk.dynalink.jmod is the JMOD file for JDK 11 Dynamic Linking module. JDK 11 Dynamic Linking ...
JDK 11 jdk.xml.dom.jmod is the JMOD file for JDK 11 XML DOM module. JDK 11 XML DOM module compiled c...
What Is XMLBeans xbean.jar 2.6.0? XMLBeans xbean.jar 2.6.0 is the JAR file for Apache XMLBeans 2.6.0...
Apache Log4j Core Implementation provides the functional components of the logging system. Users are...
What JAR files are required to run sax\Writer.java provided in the Apache Xerces package? 1 JAR file...