Return-Path: X-Original-To: apmail-logging-log4j-user-archive@www.apache.org Delivered-To: apmail-logging-log4j-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C9A361195F for ; Fri, 1 Aug 2014 19:16:59 +0000 (UTC) Received: (qmail 32512 invoked by uid 500); 1 Aug 2014 19:16:59 -0000 Delivered-To: apmail-logging-log4j-user-archive@logging.apache.org Received: (qmail 32456 invoked by uid 500); 1 Aug 2014 19:16:58 -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 32444 invoked by uid 99); 1 Aug 2014 19:16:58 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Aug 2014 19:16:58 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [209.85.220.169] (HELO mail-vc0-f169.google.com) (209.85.220.169) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Aug 2014 19:16:56 +0000 Received: by mail-vc0-f169.google.com with SMTP id le20so7291023vcb.14 for ; Fri, 01 Aug 2014 12:16:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=calmus.org; s=google; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=cb6mK2J9U649QwKzTWZ4uxwHKiontE77Cjv7zBm6wsw=; b=QAriHV6BI5NtdDjpTOn7oJ7GDwsHmi3lz74lWT9LcPK+GhPUYEkxD+qNubfAemMj3s r8Y+Q0dJu51egN9kdwQnvyzdpiYJj3r7BSOMXrbg7Xz4LVGQlqGXmYmNb3vBkBLETZgf ceqjgnfydsqJn42nbrXWOykZp+DWoUx0qXsSw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=cb6mK2J9U649QwKzTWZ4uxwHKiontE77Cjv7zBm6wsw=; b=jw/1Bzho4851r+s8UEFW6I4g8gRFVsvp68balKC5aWIcqcOpckkA2M4yi7EeBlRCaw m8nfLQpmKRvl4z4Kugxgco+hP9jFbUn+6YWkNKZR/uKktX2E4Mj4A11ttsQ4gUtI8zka Sig63aehRYAy2isYPKd023rj7qcBIzCWgK9RWKi+xn2h9Iwkx9L5kBYa+5/WKvdKHweF g6Zm7vOGLyjoEJWd4sdxqdmZ72g2DY7z3W8Ip3YRy7A8839JEv8fmuRXRX7TqmMIpGv8 IoX/FddIDZPiIhl2muYLWbVXIppo3/dLfkK1IMdnQAuRwz2HHFs5hVOprcfgwT57O0ar KHXQ== X-Gm-Message-State: ALoCoQkoiGXJbE+9dQ5YqE0oti78vOqwHy3VMDgjdabjeJ81cUh14qTKwPVSAPB0iuqANIvCX9wI MIME-Version: 1.0 X-Received: by 10.220.46.5 with SMTP id h5mr5570792vcf.55.1406920589913; Fri, 01 Aug 2014 12:16:29 -0700 (PDT) Received: by 10.58.162.66 with HTTP; Fri, 1 Aug 2014 12:16:29 -0700 (PDT) X-Originating-IP: [214.3.118.230] In-Reply-To: <170BB361-8FAF-407D-AEDC-EF3C5B931117@dslextreme.com> References: <170BB361-8FAF-407D-AEDC-EF3C5B931117@dslextreme.com> Date: Fri, 1 Aug 2014 15:16:29 -0400 Message-ID: Subject: Re: problems with web app and JndiContextSelector From: Mike Calmus To: Log4J Users List Content-Type: multipart/alternative; boundary=001a11c2d2befd49bd04ff9639bf X-Virus-Checked: Checked by ClamAV on apache.org --001a11c2d2befd49bd04ff9639bf Content-Type: text/plain; charset=UTF-8 We're using a Servlet 2.5 container and configuration. I added the Log4jContextSelector environment variable to the container startup as well as loading all the Log4j 2.0 jars with the container. I added the following items to my web.xml: isLog4jContextSelectorNamed true log4jContextName myapp log4jConfiguration file:///${sys:projectprops}/myapp/default/log4j2.xml org.apache.logging.log4j.web.Log4jServletContextListener log4jServletFilter org.apache.logging.log4j.web.Log4jServletFilter log4jServletFilter /* REQUEST FORWARD INCLUDE ERROR With just this, logging works fine, but I get an error when the JNDI lookup fails. Sets the logging context for the web-app log4j/context-name java.lang.String myapp The JNDI lookup error goes away but logging stops working. I also tried adding the following with no change in results. URL for configuring log4j context log4j/configuration-resource java.lang.String file:///${sys:projectprops}/myapp/default/log4j2.xml On Tue, Jul 29, 2014 at 11:37 AM, Ralph Goers wrote: > The best would be a sample project that demonstrates the problem. At a > minimum I would think the web.xml and log4j 2 configuration. > > Ralph > > On Jul 29, 2014, at 5:47 AM, Mike Calmus wrote: > > > I am having problems moving our web app over to Log4j 2.0 using JNDI > > lookups. I followed the configuration documentation and am not getting > any > > errors, but nothing is being logged to my configured appenders. Weirdly, > if > > I remove the JNDI env-entry configuration from web.xml logging seems to > > work, albeit with the expected NameNotFoundException in the server > output. > > > > One possibly relevant configuration difference is that we load the log4j > > jar files as part of server startup so each app doesn't have to load > them. > > > > Any ideas? What configuration can I provide to help troubleshoot? > > > > Thanks. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org > For additional commands, e-mail: log4j-user-help@logging.apache.org > > --001a11c2d2befd49bd04ff9639bf--