[slf4j-user] Extend slf4j Tracing Levels

Robert Elliot rob at lidalia.org.uk
Fri May 11 12:47:48 CEST 2012


Short answer: no.

Longer answer:

The point of SLF4J is it's a common facade or interface; you then choose an implementation (logback, slf4j-log4j, slf4j-jdk14 etc.).  Obviously the existing implementations only know about & support the levels defined on the existing interface.

Obviously you could write your own interface that extends the slf4j Logger interface and adds those methods, but what would you do with the calls to them? To get support for new levels you would need to write your own implementation which implements your new interface with its new methods.  You'd then have a coupling between your custom implementation and your custom extension of the SLF4J interface; and in all probability a tight coupling from your custom implementation to an existing logging subsystem that supports defining new levels.

I believe Markers are intended to support some of the use cases that might otherwise be achieved by custom log levels.

----- Original Message -----
> From: "William Shatner" <shatner.william at gmail.com>
> To: slf4j-user at qos.ch
> Sent: Friday, 11 May, 2012 11:27:33 AM
> Subject: [slf4j-user] Extend slf4j Tracing Levels
> Hi,
> 
> Is it possible to extend slf4j tracing levels to have more fine
> grained levels beyond the standard error,info etc.
> 
> e.g
> 
> logger.info
> logger.infoPlus
> ...
> logger.error
> logger.error1
> logger.error2
> 
> ..
> 
> 
> Thanks,
> Will
> 
> _______________________________________________
> slf4j-user mailing list
> slf4j-user at qos.ch
> http://mailman.qos.ch/mailman/listinfo/slf4j-user


More information about the slf4j-user mailing list