I fixed it while moving the field and method to AbstractStringLayout (to be able to use from GelfLayout as well).
On Tue, Mar 22, 2016 at 12:55 PM, Mikael Ståldal <[email protected]> wrote: > I am working on a fix. > > On Tue, Mar 22, 2016 at 11:52 AM, Remko Popma <[email protected]> > wrote: > >> I think you're right. This should be an instance field, not a static >> field. Good catch! >> >> >> On Tuesday, 22 March 2016, Mikael Ståldal <[email protected]> >> wrote: >> >>> In PatternLayout we have: >>> >>> private static final ThreadLocal<TextEncoderHelper> textEncoderHelper = >>> new ThreadLocal<>(); >>> >>> private TextEncoderHelper getCachedTextEncoderHelper() { >>> TextEncoderHelper result = textEncoderHelper.get(); >>> if (result == null) { >>> result = new TextEncoderHelper(getCharset()); >>> textEncoderHelper.set(result); >>> } >>> return result; >>> } >>> >>> >>> Does this really work properly? What if we have several instance of >>> PatternLayout with different charsets? >>> >>> -- >>> [image: MagineTV] >>> >>> *Mikael Ståldal* >>> Senior software developer >>> >>> *Magine TV* >>> [email protected] >>> 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* > [email protected] > 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* [email protected] 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.
