Class StdoutToLog4jFilter

  • All Implemented Interfaces:
    Closeable, Flushable, Appendable, AutoCloseable

    public class StdoutToLog4jFilter
    extends FilterWriter
    StoutToLog4jFilter is just a simple FileWriter implementation that supresses output unless the log4j priority is set to debug. This class in indended to be used with hsql embedded server and to be used like this:
    
    
     Log targetLogger = LogFactory.getLog("org.hsqldb");
     server.setLogWriter(new PrintWriter(new StdoutToLog4jFilter(server.getLogWriter(), targetLogger)));
    
     
    Author:
    Daniel Bevenius