[logback-user] Object Rendering for Logback as Log4j

David Roussel nabble at diroussel.xsmail.com
Tue Sep 3 16:19:13 CEST 2013


Gaston,

I don't think there is such support. But you could add support in your own custom format or custom appender. I guess. 

David

On 2 Sep 2013, at 15:47, gaston sponer <gaston.sponer at hotmail.com> wrote:

> 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;
> }
> 
> 
> _______________________________________________
> Logback-user mailing list
> Logback-user at qos.ch
> http://mailman.qos.ch/mailman/listinfo/logback-user
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.qos.ch/pipermail/logback-user/attachments/20130903/d4f45cf2/attachment.html>


More information about the Logback-user mailing list