Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 2E785200C14 for ; Tue, 7 Feb 2017 14:53:14 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 2CE0B160B4B; Tue, 7 Feb 2017 13:53:14 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 52E01160B3E for ; Tue, 7 Feb 2017 14:53:13 +0100 (CET) Received: (qmail 73221 invoked by uid 500); 7 Feb 2017 13:53:12 -0000 Mailing-List: contact log4net-user-help@logging.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: "Log4NET User" List-Id: Delivered-To: mailing list log4net-user@logging.apache.org Received: (qmail 73211 invoked by uid 99); 7 Feb 2017 13:53:12 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Feb 2017 13:53:12 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 1A8AA1A048C for ; Tue, 7 Feb 2017 13:53:12 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.38 X-Spam-Level: ** X-Spam-Status: No, score=2.38 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, HTML_OBFUSCATE_05_10=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_SORBS_SPAM=0.5, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id ky3oQcvrwMCZ for ; Tue, 7 Feb 2017 13:53:08 +0000 (UTC) Received: from mail-ot0-f176.google.com (mail-ot0-f176.google.com [74.125.82.176]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 7C0915F473 for ; Tue, 7 Feb 2017 13:53:07 +0000 (UTC) Received: by mail-ot0-f176.google.com with SMTP id 32so86331007oth.3 for ; Tue, 07 Feb 2017 05:53:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=O2LHAdvvhDcDOaiw2DnhkBYsrBj+PUBVjWDpNGMISjw=; b=qC7n+s3qqLr2KfGQ2g1bV7h/6V1PwkpDAlyGIf0xT0y770L9oOE+Ni8VwpsmrqSS+3 joIg0P/l3Kh4y7IMKxBm87OL7VYnzqH7XHjk+P2zahMd6cd2H5w4i/vh7ixRaQmZ41fc VQHYeAHyKmPx7u4d5tQv3PVn6Pd++lPONY5JjHPGRvKs5qdMCBD7cGsftbkFHxO0t6tC Diiav61fiwGy8IQxNzFrzVJOQtuWtPjKnHgqLF0/yBZq0pRTbWb/rs5iZN0Xq8Bpv4WU QmWt/hqVGv54sxJZlYh0ZBUSGbpFMllF7w2b2VGwe9/R1EBvvcwODIxIkihU4DhzrBOU KWag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=O2LHAdvvhDcDOaiw2DnhkBYsrBj+PUBVjWDpNGMISjw=; b=fYXoxL6vl62P8cscjV1kc12rDN2ykuYFTElFQP/U9lcbUMhk3CJPvJ5qKrLoeU7fbg zu4PSZ+J9ethkOkpdwI5IKkkoeWcbBnypq7SJmLrL7kVQ00teBMuYGNoO98lg/CdoA8t tWwdhLRuYzVG+/Bj1KHJJlXZOKlU4EaWvENx3DuvoUZQOxM+K3EH4h5Ed8utOsw1Yu3X glHlaILzWp56WjWkwReNYIonsC8KMPD+Ja7AMUhUUw1eLpDYOpepJe4MS67PBlSajN/z 0wEg2WXyr1Z2Ww4fAVpQncZkrJFDippUNcE4AcW/k4BIUwyKE/yccxEysGDISUYtlq16 CvPw== X-Gm-Message-State: AMke39l7DwO4wlPVb8DdbxOcCa9RYANi01y/PXuDu1eae7wIGNEJLRDVTFPCrwZvl29nka77qdhgQaLmzbSi8w== X-Received: by 10.157.29.100 with SMTP id m91mr8938034otm.6.1486475586016; Tue, 07 Feb 2017 05:53:06 -0800 (PST) MIME-Version: 1.0 Received: by 10.202.104.205 with HTTP; Tue, 7 Feb 2017 05:53:05 -0800 (PST) Received: by 10.202.104.205 with HTTP; Tue, 7 Feb 2017 05:53:05 -0800 (PST) In-Reply-To: <969a7bab-789c-956f-d8ca-ca9ca7cf6482@1sig.cz> References: <969a7bab-789c-956f-d8ca-ca9ca7cf6482@1sig.cz> From: Dominik Psenner Date: Tue, 7 Feb 2017 14:53:05 +0100 Message-ID: Subject: Re: Performance of PatternLayout To: Log4NET User Content-Type: multipart/alternative; boundary=001a114948f445bb8b0547f11156 archived-at: Tue, 07 Feb 2017 13:53:14 -0000 --001a114948f445bb8b0547f11156 Content-Type: text/plain; charset=UTF-8 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" 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 > > > --001a114948f445bb8b0547f11156 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
I dont have the issue number at hand, but this story soun= ds familiar and there should be one filed on jira. If you have valuable inf= ormation to add, (ideally a patch) please use the search function to find t= he 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 P= atternConverter to render it. It's the same for any context property(gl= obal,thread,event).=C2=A0 If there is a %property{smthing} in PatternC= onverter's string, the logging process results into call of Principal.W= indowsIdentity.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.CreateComposite= Properties() is getting this property.=C2=A0 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 us= e some custom property in the event, the logging process is ~10 times slowe= r.

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 dev= elopers?

MK


--001a114948f445bb8b0547f11156--