Comments (5)
It is log4j version 1.x that log4j-over-slf4j mocks.
The log4j-over-slf4j documentation was updated to dissipate any ambiguity.
from slf4j.
Thank you @ceki!
By log4j 1.x
you mean that any feature available in the latest
version of log4j will be also available at log5j-over-slf4j?
from slf4j.
The reason I'm asking is because I saw that I'm able to use %marker
in the PatternLayout, which isn't available in 1.x docs, only in 2.x docs.
However, I'm not able to use %notEmpty{[%marker]}
, which is also only available in 2.x docs.
I'm trying to understand what features I can and can't use.
from slf4j.
Here is what the documentation states:
SLF4J ships with a module called log4j-over-slf4j. It allows log4j 1.x users (but not log4j 2.x) to migrate existing applications to SLF4J without changing a single line of code but simply by replacing the log4j.jar file with log4j-over-slf4j.jar, as described below.
Are you trying to migrate an existing application or library using log4j 1.x to SLF4J? That is the use case that log4j-over-slf4j.jar
caters for.
from slf4j.
That's not the case, my application is currently using log4j-over-slf4j:1.7.x
.
What I'm actually looking for is the correct documentation for my application.
I've the following dependencies:
I'm without answers for some questions. For example:
- Should I look for log4j 1.x docs or logback docs while working with log4j-over-sl4j?
- Why some features from log4j 2.x are available like
%marker
and others aren't like%notEmpty{[%marker]}
?- For what I could check, log4j 1.x doesn't accept
%marker
. (docs)
- For what I could check, log4j 1.x doesn't accept
- What's the proper way to make
LoggerFactory.getLogger()
return my custom Logger instead oforg.apache.log4j.Logger
?- Note that I want to make
LoggerFactory.getLogger()
return my custom Logger instead of create also aCustomLoggerFactory
.
- Note that I want to make
- Is it possible to change the default logger
LOGGER_FACTORY_KEY
? How?
I saw many examples and ways of solve some of the questions above, but there are so many versions that is complicated to figure out the best practices reading things out of the docs. Usually the answers don't come with the dependencies and versions being used.
Anyway, I'll spend more time researching, but I'm mainly trying to override the default Logger
class without need to create a new LoggerFactory
.
I'd like to basically wrap org.apache.log4j.Logger
in my CustomLogger
and bind this CustomLogger
as default to my application. But I'm having a bad time trying to do that with the packages I've available.
from slf4j.
Related Issues (20)
- No-op logger is not a sane default
- MDC Usage regression HOT 10
- [question] How do you pronounce SLF4J?
- Message formatting with last argument being Throwable
- Explicit provider fails when used with module system HOT 4
- Some links from FAQ document don't work. HOT 1
- MavenGate (CVE)
- MDC + Context Propagation Feature Request HOT 9
- [Feature Request]: Add error method with varargs and Throwable in Logger interface
- `slf4j-api-2.0.11` throws `java.lang.NullPointerException` in Android build HOT 1
- Deprecate `jcl-over-slf4j` for removal HOT 2
- putCloseable should not remove the key from MDC if it was previously set to a different value
- JUL bridge and System.Logger are inconsistent on handling of OFF and ALL HOT 9
- Wrong classname when using slf4j inside a wrapper and logging via LoggingEventBuilder HOT 6
- slf4j doesn't work on the docker HOT 4
- load slf4j 2.0.x Exceptions in OSGI , the version number and check mode are incorrect.
- SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder"
- [BUG] - JCL-Over-SLF4J Module Definition does not specify the service loader for JPMS applications HOT 1
- org.slf4j.LoggerFactory (in module org.slf4j) cannot access class org.slf4j.impl.StaticLoggerBinder (JPMS APPLICATION) HOT 2
- Can this Library use in android app ?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from slf4j.