Awesome! Re: appenders:
We went through a couple of code re-orgs back in 2011 and 2013, some stuff was moved out of Chainsaw to apache-log4j-extras. Looks like some was left behind. You can define Chainsaw as an appender yourself - so the UI starts if it's in the log4j xml config file. Because Chainsaw is an appender itself (a graphical one), Chainsaw hooks in to the existing log4j configuration dynamically as an appender to receive events, and we use that plumbing to process all events received by a Receiver. After building a LoggingEvent from the source, a Receiver pushes the event to the appender framework by calling: // get the "local" logger for this event from the // configured repository. Logger localLogger = getLoggerRepository().getLogger(event.getLoggerName()); // if the logger level is greater or equal to the level // of the event, use the logger to append the event. if (event.getLevel() .isGreaterOrEqual(localLogger.getEffectiveLevel())) { // call the loggers appenders to process the event localLogger.callAppenders(event); } } Scott On 11/20/17, Mikael Ståldal <mi...@apache.org> wrote: > I took a look at the Chainsaw source code, and tried to remove its > dependency on Log4j 1 and migrate to Log4j 2. > > That was not easy, Chainsaw heavily depends on intricate Log4j 1 > implementation details. There is a lot of tedious but straight-forward > search/replace kind of work to do. But quite some more tricky stuff > which I couldn't figure out all of. > > I haven't yet got it to compile, and I got tired of it for the moment. > But I have pushed my (unfinished) work to branch "log4j-2". > > Maybe we need to take another apporach. There seems to be quote some > code there which is more or less unused, like all those Appenders (why > does Chainsaw need appenders? shouldn't it receive log events?). > > Maybe we should try to clean up the current codebase and remove as much > unused and obsolete stuff (stuff that will be obsolete when we have > migrated to Log4j 2) as possible before migrating? >