[logback-user] Logback - adding appenders
Thorbjørn Ravn Andersen
thunderaxiom at hotmail.com
Tue May 15 13:06:42 CEST 2012
What exactly is it you want to intercept?
Is it to make an existing application using log4j or similar do something
From: logback-user-bounces at qos.ch [mailto:logback-user-bounces at qos.ch] On
Behalf Of Jan Moravec
Sent: 15. maj 2012 12:41
To: logback-user at qos.ch
Subject: [logback-user] Logback - adding appenders
I am building a JVM agent that needs to programmatically register a logback
appender to intercept logging messages from a web-application(s) running on
the given JVM. By using the JVM agent I can avoid modifying the
web-applications code & configuration. To make this work, I need to use
byte-code instrumentation and in the class-loading phase modify some logback
class(es) and inject my code that instantiates my (interception) appender
and adds it to list of appenders associated with the root logger. What would
be the best logback API class and method to instrument?
Ideally it should be a class and method that:
· Is called once upon every logback (re)initialization
· Has been present in older logback versions.
· Is public, stable and is not likely to disappear in future logback
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Logback-user