forked from I2P_Developers/i2p.i2p
i2psnark standalone: Redirect jetty logging to i2p log
This commit is contained in:
@ -4,9 +4,12 @@ import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.Properties;
|
||||
|
||||
import org.eclipse.jetty.util.log.Log;
|
||||
|
||||
import net.i2p.I2PAppContext;
|
||||
import net.i2p.apps.systray.UrlLauncher;
|
||||
import net.i2p.data.DataHelper;
|
||||
import net.i2p.jetty.I2PLogger;
|
||||
import net.i2p.jetty.JettyStart;
|
||||
|
||||
/**
|
||||
@ -29,6 +32,13 @@ public class RunStandalone {
|
||||
} catch (IOException ioe) {}
|
||||
}
|
||||
_context = new I2PAppContext(p);
|
||||
// Do this after we have a context
|
||||
// To take effect, must be set before any Jetty classes are loaded
|
||||
try {
|
||||
Log.setLog(new I2PLogger());
|
||||
} catch (Throwable t) {
|
||||
System.err.println("INFO: I2P Jetty logging class not found, logging to stdout");
|
||||
}
|
||||
File base = _context.getBaseDir();
|
||||
File xml = new File(base, "jetty-i2psnark.xml");
|
||||
_jettyStart = new JettyStart(_context, null, new String[] { xml.getAbsolutePath() } );
|
||||
|
Reference in New Issue
Block a user