You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by Mikael Ståldal <mi...@magine.com> on 2016/03/22 16:10:28 UTC

RingBufferLogEvent#StringBuilderWrapperMessage is incomplete

I think that RingBufferLogEvent#StringBuilderWrapperMessage need to have a
proper implementation of getFormattedMessage(), otherwise layouts and
appenders which does not use formatTo() will not work.

-- 
[image: MagineTV]

*Mikael Ståldal*
Senior software developer

*Magine TV*
mikael.staldal@magine.com
Grev Turegatan 3  | 114 46 Stockholm, Sweden  |   www.magine.com

Privileged and/or Confidential Information may be contained in this
message. If you are not the addressee indicated in this message
(or responsible for delivery of the message to such a person), you may not
copy or deliver this message to anyone. In such case,
you should destroy this message and kindly notify the sender by reply
email.

Re: RingBufferLogEvent#StringBuilderWrapperMessage is incomplete

Posted by Mikael Ståldal <mi...@magine.com>.
I think it will be difficult to adapt all layouts (and appenders without
layouts) to use StringBuilderFormattable.formatTo(StringBuilder)
instead of String
Message.getFormattedMessage().

I suggest we add another method to StringBuilderFormattable:

CharSequence getFormattedMessageBuffer(); // feel free to suggest a better
name

That method could just return the StringBuilder, and be equally allocation
free. The each layout / appender can use whichever method is easiest in
that case.

I am looking at GelfLayout, and it would be easier to use a method
returning a CharSequence instead of formatTo(StringBuilder).

On Tue, Mar 22, 2016 at 4:50 PM, Mikael Ståldal <mi...@magine.com>
wrote:

> Should we to the trimming in getFormattedMessage() as well as in
> toFormat()?
>
> On Tue, Mar 22, 2016 at 4:38 PM, Remko Popma <re...@gmail.com>
> wrote:
>
>> Thanks! Done.
>>
>> Sent from my iPhone
>>
>> On 2016/03/23, at 0:10, Mikael Ståldal <mi...@magine.com> wrote:
>>
>> I think that RingBufferLogEvent#StringBuilderWrapperMessage need to have
>> a proper implementation of getFormattedMessage(), otherwise layouts and
>> appenders which does not use formatTo() will not work.
>>
>> --
>> [image: MagineTV]
>>
>> *Mikael Ståldal*
>> Senior software developer
>>
>> *Magine TV*
>> mikael.staldal@magine.com
>> Grev Turegatan 3  | 114 46 Stockholm, Sweden  |   www.magine.com
>>
>> Privileged and/or Confidential Information may be contained in this
>> message. If you are not the addressee indicated in this message
>> (or responsible for delivery of the message to such a person), you may
>> not copy or deliver this message to anyone. In such case,
>> you should destroy this message and kindly notify the sender by reply
>> email.
>>
>>
>
>
> --
> [image: MagineTV]
>
> *Mikael Ståldal*
> Senior software developer
>
> *Magine TV*
> mikael.staldal@magine.com
> Grev Turegatan 3  | 114 46 Stockholm, Sweden  |   www.magine.com
>
> Privileged and/or Confidential Information may be contained in this
> message. If you are not the addressee indicated in this message
> (or responsible for delivery of the message to such a person), you may not
> copy or deliver this message to anyone. In such case,
> you should destroy this message and kindly notify the sender by reply
> email.
>



-- 
[image: MagineTV]

*Mikael Ståldal*
Senior software developer

*Magine TV*
mikael.staldal@magine.com
Grev Turegatan 3  | 114 46 Stockholm, Sweden  |   www.magine.com

Privileged and/or Confidential Information may be contained in this
message. If you are not the addressee indicated in this message
(or responsible for delivery of the message to such a person), you may not
copy or deliver this message to anyone. In such case,
you should destroy this message and kindly notify the sender by reply
email.

Re: RingBufferLogEvent#StringBuilderWrapperMessage is incomplete

Posted by Mikael Ståldal <mi...@magine.com>.
Should we to the trimming in getFormattedMessage() as well as in toFormat()?

On Tue, Mar 22, 2016 at 4:38 PM, Remko Popma <re...@gmail.com> wrote:

> Thanks! Done.
>
> Sent from my iPhone
>
> On 2016/03/23, at 0:10, Mikael Ståldal <mi...@magine.com> wrote:
>
> I think that RingBufferLogEvent#StringBuilderWrapperMessage need to have a
> proper implementation of getFormattedMessage(), otherwise layouts and
> appenders which does not use formatTo() will not work.
>
> --
> [image: MagineTV]
>
> *Mikael Ståldal*
> Senior software developer
>
> *Magine TV*
> mikael.staldal@magine.com
> Grev Turegatan 3  | 114 46 Stockholm, Sweden  |   www.magine.com
>
> Privileged and/or Confidential Information may be contained in this
> message. If you are not the addressee indicated in this message
> (or responsible for delivery of the message to such a person), you may not
> copy or deliver this message to anyone. In such case,
> you should destroy this message and kindly notify the sender by reply
> email.
>
>


-- 
[image: MagineTV]

*Mikael Ståldal*
Senior software developer

*Magine TV*
mikael.staldal@magine.com
Grev Turegatan 3  | 114 46 Stockholm, Sweden  |   www.magine.com

Privileged and/or Confidential Information may be contained in this
message. If you are not the addressee indicated in this message
(or responsible for delivery of the message to such a person), you may not
copy or deliver this message to anyone. In such case,
you should destroy this message and kindly notify the sender by reply
email.

Re: RingBufferLogEvent#StringBuilderWrapperMessage is incomplete

Posted by Remko Popma <re...@gmail.com>.
Thanks! Done. 

Sent from my iPhone

> On 2016/03/23, at 0:10, Mikael Ståldal <mi...@magine.com> wrote:
> 
> I think that RingBufferLogEvent#StringBuilderWrapperMessage need to have a proper implementation of getFormattedMessage(), otherwise layouts and appenders which does not use formatTo() will not work.
> 
> -- 
>  
> 
> Mikael Ståldal
> Senior software developer 
> 
> Magine TV
> mikael.staldal@magine.com    
> Grev Turegatan 3  | 114 46 Stockholm, Sweden  |   www.magine.com             
> 
> Privileged and/or Confidential Information may be contained in this message. If you are not the addressee indicated in this message
> (or responsible for delivery of the message to such a person), you may not copy or deliver this message to anyone. In such case, 
> you should destroy this message and kindly notify the sender by reply email.