You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4net-user@logging.apache.org by Nicholas Duane <ni...@msn.com> on 2015/09/18 21:05:24 UTC

layout being reused?

I seem to have run into an issue where either an instance of a layout object is being reused in another appender or it's reusing the params under a layout.  Here is what I did:

<appender ...>
   ...
   <layout ...>
      <myprop value="..."/>
   </layout>
</appender>
...
<appender ...>
   ...
   <layout ...>
   </layout>
</appender>

To my surprise, the layout in the second (lower) appender above had the "myprop" property set to the value from the first appender's layout.  By the way, both layouts are the same type.  It's a custom layout I wrote.

Thankfully, if I set the property in both layouts to a different value, each layout has the correct value.  So the problem seems to be that if a layout takes a parameter and you don't supply it you might end up getting the value set based on it being set in a previous layout.

Can someone verify that this is indeed an issue?

Thanks,
Nick