logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gary Gregory <garydgreg...@gmail.com>
Subject Re: Bulk logging for 2.0?
Date Sun, 15 Jul 2012 20:58:04 GMT
On Jul 15, 2012, at 11:31, Ralph Goers <ralph.goers@dslextreme.com> wrote:

> On Jul 15, 2012, at 7:41 AM, Gary Gregory wrote:
>
>> Hi All,
>>
>> I have many cases in 1.2 where I log "in bulk". The simplest example would be to
log all system properties.
>>
>> Depending on the case, I care (or not) that all log entries in the bulk are non-interlaced
with other log entries (from other threads).
>>
>> So I have cases where I log maps, lists, and arrays. With 1.2, I have to have my
own loops for create log entries.
>>
>> Any thought of providing additional APIs to do this? Before I work on a proposal,
I'd like a feel for if this is out of scope for 2.0.
>>
>> Thank you!
>
> You just need to create a custom Message.  See MapMessage or ThreadDumpMessage for examples.
 You could also define a Message that has a put method to add items to it.  When the message
is rendered the rendering would format them however you want but essentially as one String,
which is the only way to guarantee the lines stay together in the log.

I'll have to play with that idea. Thank you for the tip.

Gary

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

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


Mime
View raw message