logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominik Psenner <dpsen...@gmail.com>
Subject Re: Performance of PatternLayout
Date Tue, 07 Feb 2017 13:53:05 GMT
I dont have the issue number at hand, but this story sounds familiar and
there should be one filed on jira. If you have valuable information to add,
(ideally a patch) please use the search function to find the issue.

On 7 Feb 2017 9:02 a.m., "Martin Kozubek" <kozubek@1sig.cz> wrote:

> Hello,
> I have noticed performance hit after adding a custom property and using a
> PatternConverter to render it. It's the same for any context
> property(global,thread,event).  If there is a %property{smthing} in
> PatternConverter's string, the logging process results into call of
> Principal.WindowsIdentity.GetCurrent().Name.
> The code containing this call is in the LoggingEvent class. It is getter
> of property UserName. Since log4net v 1.2.12 the
> LoggingEvent.CreateCompositeProperties() is getting this property.  The
> problem is that this method is called once for logging event whenever there
> is some %property{} to be rendered.
> This results in that even if I don't use the username, but I add and use
> some custom property in the event, the logging process is ~10 times slower.
> I can solve it by programming my own layout instead of PatternLayout, but
> I am wondering if is it an expected behavior. Should that be reported to
> developers?
> MK

View raw message