[logback-user] Object domain from layouts

gaston sponer gaston.sponer at hotmail.com
Thu Jul 25 23:20:15 CEST 2013


Thanks David, i understand you point but i'm still can't access to any Employee attribute, this is what i see using getArgumentArray():
sbuf.append(event.getArgumentArray()[0]);
Console:INFO [main] Fred ............... com.render.domain.Employee at 39f58a0e
and traying to get some attributes to this object I only can access to getClass(), there is no getId(), getSalary() or getCompany().
event.getArgumentArray()[0].getClass()
Any idea?
Thanks Best regards.

From: nabble at diroussel.xsmail.com
Date: Thu, 25 Jul 2013 21:39:56 +0100
To: logback-user at qos.ch
Subject: Re: [logback-user] Object domain from layouts

In your app code call the logger like this:
log.info("Employee: {}", myEmployee);
Then in the formatter, call event.getArgumentArray() - http://logback.qos.ch/xref/ch/qos/logback/classic/spi/LoggingEvent.html#143
Then look at each arg and check if it is an Employee. 

David

_______________________________________________
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/20130725/5a89a169/attachment.html>


More information about the Logback-user mailing list