The class example below MyAppender is called from the logback.xml file.
When the append() is called by logback i have no reference to the
class MyAppenderso i cannot attach any Observer or register a Listener
Does logback have some Listener the Swing gui can register or what should i do?
Have been reading the logback manual but i cannot figure this out.
public class MongoAppender extends AppenderBase<ILoggingEvent> {
public MongoAppender () {
}
@Override
public void start() {
super.start();
}
public void append(ILoggingEvent event) {
// Inserting log event into MongoDb
// just got an error...
// how do i send this error back to Swing Gui?
}
}
In the
appendi did not make and call to the gui.I ended up writing to the DB whatever needed to be saved.
This of course is cleaner and safer then having classes trying to
address each other.