[logback-user] Object Rendering for Logback as Log4j
gaston sponer
gaston.sponer at hotmail.com
Mon Sep 2 16:47:57 CEST 2013
Hi, Any answer for this?Hi,
I am new to logback, and I was asked to migrate our project from log4j to
logback. I was wondering if there's any kind of support for object
rendering such as in log4j.
This is what we're now doing with log4j.
public static LoggerRepository getLoggerRepository() {
if (loggerRepository == null) {
loggerRepository =
org.apache.log4j.LogManager.getLoggerRepository();
}
return loggerRepository;
}
public static RendererSupport getRendererSupport() {
LoggerRepository lr = getLoggerRepository();
if ((lr != null) && (lr instanceof RendererSupport))
rendererSupport = (RendererSupport) lr;
return rendererSupport;
}
public static ObjectRender getRendererObject(Class<?> clazz) {
ObjectRender renderer =
getRendererSupport().getRendererMap().get(clazz);
return renderer;
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.qos.ch/pipermail/logback-user/attachments/20130902/dd388bfe/attachment.html>
More information about the Logback-user
mailing list