Return-Path: X-Original-To: apmail-logging-log4j-dev-archive@www.apache.org Delivered-To: apmail-logging-log4j-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7D56611E56 for ; Thu, 7 Aug 2014 12:01:20 +0000 (UTC) Received: (qmail 27597 invoked by uid 500); 7 Aug 2014 12:01:20 -0000 Delivered-To: apmail-logging-log4j-dev-archive@logging.apache.org Received: (qmail 27535 invoked by uid 500); 7 Aug 2014 12:01:20 -0000 Mailing-List: contact log4j-dev-help@logging.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Log4J Developers List" Reply-To: "Log4J Developers List" Delivered-To: mailing list log4j-dev@logging.apache.org Received: (qmail 27518 invoked by uid 99); 7 Aug 2014 12:01:20 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Aug 2014 12:01:20 +0000 Date: Thu, 7 Aug 2014 12:01:19 +0000 (UTC) From: "Krzysztof Szewczyk (JIRA)" To: log4j-dev@logging.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (LOG4J2-770) All method addOnLogging() in Logger interface MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/LOG4J2-770?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Krzysztof Szewczyk updated LOG4J2-770: -------------------------------------- Description: It would be useful to add method addOnLogging or similar that would be enable the addition action during logging. In my work copy I did something like that: - I created: >>public interface OnLogging{ public void onLogging(Level level, Object message, Throwable ex); }<< - I added to interface Logger method: >>public void addOnLogging(OnLogging ol);<< - in Logger implementations I added: >>private List onLoggingList;<<, implemented: >>public addOnLogging(OnLogging ol){ onLoggingList.add(ol); }<< and on method: >>public void logMessage(final String fqcn, final Level level, final Marker marker, final Message msg, final Throwable throwable)<< I added: >>for(OnLogging ol : onLoggingList) { ol.onLogging(level, msg, t); }<< I needed it because I wanted to bind logs with my gui - on logging action I update some control to give user some information. I hope that you will consider it a useful feature was: It would be useful to add method addOnLogging or similar that would be enable the addition action during logging. In my work copy I did somethink like that: - I created: >>public interface OnLogging{ public void onLogging(Level level, Object message, Throwable ex); }<< - I added to interface Logger method: >>public void addOnLogging(OnLogging ol);<< - in Logger implementations I added: >>private List onLoggingList;<<, implemented: >>public addOnLogging(OnLogging ol){ onLoggingList.add(ol); }<< and on method: >>public void logMessage(final String fqcn, final Level level, final Marker marker, final Message msg, final Throwable throwable)<< I added: >>for(OnLogging ol : onLoggingList) { ol.onLogging(level, msg, t); }<< I needed it because I wanted to bind logs with my gui - on logging action I update some control to give user some information. I hope that you will consider it a useful feature > All method addOnLogging() in Logger interface > --------------------------------------------- > > Key: LOG4J2-770 > URL: https://issues.apache.org/jira/browse/LOG4J2-770 > Project: Log4j 2 > Issue Type: New Feature > Components: API, Core > Reporter: Krzysztof Szewczyk > > It would be useful to add method addOnLogging or similar that would be enable the addition action during logging. > In my work copy I did something like that: > - I created: > >>public interface OnLogging{ public void onLogging(Level level, Object message, Throwable ex); }<< > - I added to interface Logger method: > >>public void addOnLogging(OnLogging ol);<< > - in Logger implementations I added: > >>private List onLoggingList;<<, > implemented: > >>public addOnLogging(OnLogging ol){ onLoggingList.add(ol); }<< > and on method: > >>public void logMessage(final String fqcn, final Level level, final Marker marker, final Message msg, final Throwable throwable)<< > I added: > >>for(OnLogging ol : onLoggingList) { ol.onLogging(level, msg, t); }<< > I needed it because I wanted to bind logs with my gui - on logging action I update some control to give user some information. > I hope that you will consider it a useful feature -- This message was sent by Atlassian JIRA (v6.2#6252) --------------------------------------------------------------------- To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org For additional commands, e-mail: log4j-dev-help@logging.apache.org