logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Remko Popma <remko.po...@gmail.com>
Subject Re: Typed log messages
Date Wed, 23 Jul 2014 11:54:53 GMT
Darn, I missed that Ralph had already replied...

Sent from my iPhone

> On 2014/07/23, at 19:50, Ralph Goers <rgoers@apache.org> wrote:
> 
> If I understand correctly, you should create a custom Message that contains the object.
The getFormattedMessage method should convert the object to a string. You can also create
a Layout to format the object however you want if the event contains your custom Message.
> 
> Sent from my iPad
> 
>> On Jul 23, 2014, at 2:40 AM, David KOCH <dkoch@ezakus.com> wrote:
>> 
>> Hi,
>> 
>> When I log I do: object_instance -> JSON -> string,
>> logger.log(<my_json_string_from_object>) in the application only to do the
>> de-serialisation in each of my custom appenders' append(LogEvent) methods,
>> followed by appender-specific processing on the de-serialised object.
>> 
>> I would like to know how can I make the serialisation/de-serialisation
>> procedure less "manual", like I just call logger.log(<my_Object>) and the
>> LogEvent processed inside the appender's append method contains the object
>> inside (<my_class>) LogEvent.getMessage().
>> 
>> Thanks,
>> 
>> David
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Mime
View raw message