Lumbermill with Log4J looks great, but I don't want the socket connector for
Lumbermill to be running all the time, I'd like to be able to hit a servlet
at sets up the appender, then have Lumbermill connect to the server and
start showing the logging info.

I thought it would be easy to do, but I can't seem to get it working right.
My code looks like this:

public static final String LUMBERMILL_APPENDER_NAME = "LogServer";

public static boolean isLumbermillSocketAppenderRunning() {
        Logger rootLog = Logger.getRootLogger();
        Appender app = rootLog.getAppender(LUMBERMILL_APPENDER_NAME);
        return (app != null);
}

public static void startLumbermillSocketAppender () {
        Logger rootLog = Logger.getRootLogger();
        SocketAppender app = new SocketAppender("localhost", 4445);
        app.setName(LUMBERMILL_APPENDER_NAME);
        rootLog.addAppender(app);
}

public static void stopLumbermillSocketAppender () {
        Logger rootLog = Logger.getRootLogger();
        rootLog.removeAppender(LUMBERMILL_APPENDER_NAME);
}

the method to check if there is an appender with the name LogServer works
well, but the start and stop don't seem to do anything.

Even when I start up the socket appender in the log4j.properties (and
lumbermill works properly), I can't get it to stop with my stop method. Any
ideas?

Thanks in advance,
        Jesse Vitrone


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to