<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'><div>Thanks David, i understand you point but i'm still can't access to any Employee attribute, this is what i see using getArgumentArray():</div><div><br></div><div><span style="font-size: 12pt;">sbuf.append(event.getArgumentArray()[0]);</span></div><div><span style="font-size: 12pt;"><br></span></div><div><span style="font-size: 12pt;">Console:</span></div><div>INFO [main] Fred ............... com.render.domain.Employee@39f58a0e</div><div><br></div><div>and traying to get some attributes to this object I only can access to getClass(), there is no getId(), getSalary() or getCompany().</div><div><br></div><div><span style="font-size: 12pt;">event.getArgumentArray()[0].getClass()</span></div><div><span style="font-size: 12pt;"><br></span></div><div><span style="font-size: 12pt;">Any idea?</span></div><div><span style="font-size: 12pt;"><br></span></div><div><span style="font-size: 12pt;">Thanks </span></div><div><span style="font-size: 12pt;">Best regards.</span></div><div><span style="font-size: 12pt;"><br></span></div><br><div><hr id="stopSpelling">From: nabble@diroussel.xsmail.com<br>Date: Thu, 25 Jul 2013 21:39:56 +0100<br>To: logback-user@qos.ch<br>Subject: Re: [logback-user] Object domain from layouts<br><br><div>In your app code call the logger like this:</div><div><br></div><div>log.info("Employee: {}", myEmployee);</div><div><br></div><div>Then in the formatter, call event.getArgumentArray() - <a href="http://logback.qos.ch/xref/ch/qos/logback/classic/spi/LoggingEvent.html#143" target="_blank">http://logback.qos.ch/xref/ch/qos/logback/classic/spi/LoggingEvent.html#143</a></div><div><br></div><div>Then look at each arg and check if it is an Employee. <br><br>David</div><div><br></div><br>_______________________________________________
Logback-user mailing list
Logback-user@qos.ch
http://mailman.qos.ch/mailman/listinfo/logback-user</div> </div></body>
</html>