From log4j-user-return-28998-archive-asf-public=cust-asf.ponee.io@logging.apache.org Wed Jul 25 21:03:09 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 81BE518062C for ; Wed, 25 Jul 2018 21:03:08 +0200 (CEST) Received: (qmail 13130 invoked by uid 500); 25 Jul 2018 19:03:07 -0000 Mailing-List: contact log4j-user-help@logging.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Log4J Users List" Reply-To: "Log4J Users List" Delivered-To: mailing list log4j-user@logging.apache.org Received: (qmail 13119 invoked by uid 99); 25 Jul 2018 19:03:07 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Jul 2018 19:03:07 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id EE055C1A63 for ; Wed, 25 Jul 2018 19:03:06 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.888 X-Spam-Level: * X-Spam-Status: No, score=1.888 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001, T_DKIMWL_WL_MED=-0.01] autolearn=disabled Authentication-Results: spamd4-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id p7Zb3D69oY-N for ; Wed, 25 Jul 2018 19:03:05 +0000 (UTC) Received: from mail-io0-f196.google.com (mail-io0-f196.google.com [209.85.223.196]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 7F12A5F18F for ; Wed, 25 Jul 2018 19:03:05 +0000 (UTC) Received: by mail-io0-f196.google.com with SMTP id r15-v6so7213065ioa.3 for ; Wed, 25 Jul 2018 12:03:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=Xs3sxzE4xooW4X7DpLQGJJz2fUijBKWEv9gijqIg9oU=; b=O58qHRHs0oDx0ktDOND1d2GNsg8kbJ8RADpu7vxg7IMnPtbNFz6vAb+KUO+wnOmuqt bYkB4lShewDkRjzQvJjljw5vzq4HKcRcKZQoN7o0AlexpuP2sq1uvoeS+MD8XNf7Owa5 cQKKSsLnCi+7E5twCZWPhZ0MHZPTB/6GdGKBmueta+MmIWoFrv4VTnL9As8hIqavTAmS VZnS89efiEHDd/wgr0DXzSwJZZ1hZouBiCwSrUrMuCTKv/dALDwU6og2OLaIuvizQfaZ wj88ORSjkIEJlEDMtLjVGT2qC9jbXMcr1zml3z7WKdLkalF27h5wgGcxmhPSdHVpIwZE 4aqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=Xs3sxzE4xooW4X7DpLQGJJz2fUijBKWEv9gijqIg9oU=; b=grmkndzbpGM+gwFIrE35HrcC+Y98/HrPob8pq1UIkSEYi6TnJoLCrD72gtEk/mv7KZ SLDqhy7u7NLCYPnRJ3idBJV+PP71VMxduUP9Dykgy5d3s2ey9FTdQtF8sb2gTyECw4iR vkFcZ+2a3CgTlnQnQa3M8nzBjh8PkdTE6kCm21KgBAEw4lc5Iq7GjQTrrnFE+LWW9scY uf8AV2SB9LQwiLZH8nN4UTQnX4F+mJzUwpzH/pIIjdoTrOcLQBl1uehTpVCzlbS8y+vQ +CAej4FoNx0kTA2gdT5q3qpPFO0t2iWCYXVKuiE9+yKa8OMFYU1FL9HvFOQUc0BMlMgk KoOw== X-Gm-Message-State: AOUpUlFlEELzs2n+IOfOxi1nwfr8xUJeuCMOle0RGZjpZ3ExddGpbuln hCUzcL4/7WQ5DftluTGT1Z8dJyKsAP2i5BqHUnn5CQ== X-Google-Smtp-Source: AAOMgpeFh2Zg40pA3Zqec5HiWHU8pbwZWIo7HX8JENNOou6nZ8U0n5w8xzbX7ypLDt43w9FunKNcQS5UW8YZDACJL5A= X-Received: by 2002:a6b:3347:: with SMTP id z68-v6mr17224603ioz.231.1532545384726; Wed, 25 Jul 2018 12:03:04 -0700 (PDT) MIME-Version: 1.0 References: <9EB43CDF-53DA-4AF8-9504-E76D5DC68ACF@dslextreme.com> In-Reply-To: From: Matt Sicker Date: Wed, 25 Jul 2018 14:02:53 -0500 Message-ID: Subject: Re: log4j2 under OSGi application To: Log4J Users Content-Type: multipart/alternative; boundary="0000000000004245e90571d787f2" --0000000000004245e90571d787f2 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable The typical class loader selector or bundle one are made with the assumption that you're hosting multiple applications in a single JVM. The basic one works fine when you have a single application per JVM. On Wed, 25 Jul 2018 at 12:23, Leon Finker wrote: > For our use case BasicContextSelector works as expected. We really don't > need one async logger, disruptor, thread, etc per class loader. > > On Wed, Jul 25, 2018, 1:12 PM Ralph Goers > wrote: > > > The default context selector is ClassLoaderContextSelector which create= s > a > > LoggerContext for each ClassLoader. This means that if you were to star= t > > and stop a bundle the Logging environment for that bundle should clean > up. > > When you use the BasicContextSelector there is only a single > LoggerContext > > for the whole application. As to which is correct for an OSGi > environment I > > couldn=E2=80=99t say. If we need a context selector specifically for O= SGi > > environments that can certainly be implemented, but we would have to kn= ow > > what the expected behavior is. Of course, you can always implement it a= nd > > submit it as a patch to a Jira issue. > > > > Ralph > > > > > On Jul 25, 2018, at 9:44 AM, Leon Finker wrote: > > > > > > Hi, > > > > > > Use case: provide log4j2 logging in Felix OSGi application. Nothing > OSGi > > specific as far as logging concerned. Simply need to log all logging > events > > to configured log file for the application. Using async logging. > > > > > > If we run log4j2 (any current version) with default context selector, > > then we noticed that each OSGi bundle creates a separate > AsyncLoggerConfig* > > thread with its own Disruptor, RingBuffer, etc. We have about 30+ > bundles. > > Only by setting Log4jContextSelector to > > org.apache.logging.log4j.core.selector.BasicContextSelector, this is > > prevented and one AsyncLoggerConfig/Disruptor/RingBuffer is created. > > > > > > Is this expected? > > > > > > --------------------------------------------------------------------- > > > To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org > > > For additional commands, e-mail: log4j-user-help@logging.apache.org > > > > > > > > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org > > For additional commands, e-mail: log4j-user-help@logging.apache.org > > > > > --=20 Matt Sicker --0000000000004245e90571d787f2--