I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit beb6d1f4 authored by zzz's avatar zzz
Browse files

I2PLogger fix; better log init

parent c0662bc1
No related branches found
No related tags found
No related merge requests found
......@@ -33,6 +33,11 @@ public class I2PLogger implements Logger
StringBuilder _buffer = new StringBuilder();
public I2PLogger()
{
this(I2PAppContext.getGlobalContext());
}
public I2PLogger(I2PAppContext ctx)
{
_log = ctx.logManager().getLog(Server.class);
......@@ -105,6 +110,7 @@ public class I2PLogger implements Logger
private void format(String msg, Object arg0, Object arg1)
{
_buffer.setLength(0);
int i0=msg==null?-1:msg.indexOf("{}");
int i1=i0<0?-1:msg.indexOf("{}",i0+2);
......
......@@ -221,11 +221,14 @@ public class RouterConsoleRunner {
if (!workDirCreated)
System.err.println("ERROR: Unable to create Jetty temporary work directory");
try {
Log.setLog(new I2PLogger(I2PAppContext.getGlobalContext()));
} catch (Throwable t) {
System.err.println("INFO: I2P Jetty logging class not found, logging to wrapper log");
}
//try {
// Log.setLog(new I2PLogger(I2PAppContext.getGlobalContext()));
//} catch (Throwable t) {
// System.err.println("INFO: I2P Jetty logging class not found, logging to wrapper log");
//}
// This way it doesn't try to load Slf4jLog first
System.setProperty("org.mortbay.log.class", "net.i2p.jetty.I2PLogger");
// so Jetty can find WebAppConfiguration
System.setProperty("jetty.class.path", I2PAppContext.getGlobalContext().getBaseDir() + "/lib/routerconsole.jar");
_server = new Server();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment