Krzysztof Szewczyk created LOG4J2-770:
-----------------------------------------
Summary: 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 thak 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<OnLogging> 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: [email protected]
For additional commands, e-mail: [email protected]