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 0748E183D9 for ; Fri, 26 Jun 2015 17:04:49 +0000 (UTC) Received: (qmail 17012 invoked by uid 500); 26 Jun 2015 17:04:48 -0000 Delivered-To: apmail-logging-log4j-user-archive@logging.apache.org Received: (qmail 16963 invoked by uid 500); 26 Jun 2015 17:04:48 -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 16951 invoked by uid 99); 26 Jun 2015 17:04:48 -0000 Received: from Unknown (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 26 Jun 2015 17:04:48 +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 39E53C006D for ; Fri, 26 Jun 2015 17:04:48 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.88 X-Spam-Level: ** X-Spam-Status: No, score=2.88 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=3, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd4-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-us-west.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id 0AXfFk8UZy1a for ; Fri, 26 Jun 2015 17:04:41 +0000 (UTC) Received: from mail-qc0-f171.google.com (mail-qc0-f171.google.com [209.85.216.171]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with ESMTPS id 796F02095C for ; Fri, 26 Jun 2015 17:04:41 +0000 (UTC) Received: by qczu9 with SMTP id u9so4574206qcz.3 for ; Fri, 26 Jun 2015 10:04:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=1qncJP4WTPQN74dcPH3dQvmBpycMZZ98IYyvDEdJlvg=; b=Qw/m2MCbvNx2pNAmcNquMIQybMg01ctU2dleBr5j3zEqu7MiQ69Z3LiR1+5WKLHs30 9Sa2DEJDIp+AxpxvllYe7FAjehlGl0+s7f+BeEPgWJmllSXaV/ToYsXMpeMUwcfpgrrN pq/s3O+LI5iAc8XABEU0/VmMP8miHkP+nXXQct/g7ECX6KXzE77y2xufs3YjuOhGYGF1 n7zftbHQBGyi0iANQjfV8vxP9RAII8FvxUxh6kUsSgLhUCLNzSotT7kqFKImkW2Oc0Ud OWMFIkYDDMBH6DpvuKdwb4nqxNusrtwFnnL7P8sLtEEYjRSv3YyYOFXnbb2nUnGBsBwB wNHg== MIME-Version: 1.0 X-Received: by 10.55.20.166 with SMTP id 38mr6217328qku.12.1435338275129; Fri, 26 Jun 2015 10:04:35 -0700 (PDT) Received: by 10.96.70.10 with HTTP; Fri, 26 Jun 2015 10:04:35 -0700 (PDT) In-Reply-To: <555D10FF-E32C-42C2-9072-7C1B49D79BB5@dslextreme.com> References: <555D10FF-E32C-42C2-9072-7C1B49D79BB5@dslextreme.com> Date: Fri, 26 Jun 2015 10:04:35 -0700 Message-ID: Subject: Re: SMTP appender + filter From: Benjamin Jaton To: Log4J Users List Content-Type: multipart/alternative; boundary=001a1144cea605c5c005196ebc51 --001a1144cea605c5c005196ebc51 Content-Type: text/plain; charset=UTF-8 Ah yes of course! What about : Since bufferSize can't be set to 0, is it not possible to only include the log message itself in the email? Thanks a lot! On Thu, Jun 25, 2015 at 5:41 PM, Ralph Goers wrote: > The level associated with the root appender is info. No debug events will > make it past that. > > Ralph > > > > On Jun 25, 2015, at 3:39 PM, Benjamin Jaton > wrote: > > > > Hello, > > > > I am trying to create a filter at the appender level that would show all > > the messages that contain "Show". > > This is my test: > > > > LogManager.getLogger(Test.class).debug("Hide me!"); > > LogManager.getLogger(Test.class).info("test"); > > LogManager.getLogger(Test.class).debug("Show me (debug)"); > > LogManager.getLogger(Test.class).fatal("Hide me! (fatal)"); > > LogManager.getLogger(Test.class).info("Show me (info)"); > > LogManager.getLogger(Test.class).info("Hide me!"); > > > > And this is the configuration: > > > > > > > > > smtpProtocol="..." smtpHost="..." smtpPort="..." smtpUsername="..." > > smtpPassword="..." bufferSize="1"> > > > > > > %5p %m%n > > > > > > > > > > > > > > > > > > > > > > This produces 1 email with: > > --------------------------------------- > > FATAL Hide me! (fatal) > > INFO Show me (info) > > --------------------------------------- > > > > I would expect 2 emails with: > > --------------------------------------- > > INFO test > > DEBUG Show me (debug) > > --------------------------------------- > > FATAL Hide me! (fatal) > > INFO Show me (info) > > --------------------------------------- > > > > I also tried this composite filter instead: > > > > > onMismatch="DENY" /> > > onMismatch="DENY"/> > > > > > > But same result, the DEBUG event is not triggering the appender somehow. > > > > Anyone has an idea how to do this? > > > > > > Bonus question: Since bufferSize can't be set to 0, is it not possible to > > only include the log message itself in the email? > > > > Many thanks! > > Ben > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org > For additional commands, e-mail: log4j-user-help@logging.apache.org > > --001a1144cea605c5c005196ebc51--