* Jetty logging: Fix logging using I2PLogger class;

log ignored messages at debug level
This commit is contained in:
zzz
2013-04-14 14:02:43 +00:00
parent 8bfe3f632e
commit 57b794f72a
5 changed files with 26 additions and 11 deletions

View File

@ -187,7 +187,7 @@ public class I2PLogger implements Logger
*/ */
public void ignore(Throwable ignored) public void ignore(Throwable ignored)
{ {
warn("IGNORED", ignored); debug("IGNORED", ignored);
} }
/** /**

View File

@ -29,6 +29,7 @@ import static net.i2p.app.ClientAppState.*;
import net.i2p.apps.systray.SysTray; import net.i2p.apps.systray.SysTray;
import net.i2p.data.Base32; import net.i2p.data.Base32;
import net.i2p.data.DataHelper; import net.i2p.data.DataHelper;
import net.i2p.jetty.I2PLogger;
import net.i2p.router.RouterContext; import net.i2p.router.RouterContext;
import net.i2p.router.update.ConsoleUpdateManager; import net.i2p.router.update.ConsoleUpdateManager;
import net.i2p.router.app.RouterApp; import net.i2p.router.app.RouterApp;
@ -63,6 +64,7 @@ import org.eclipse.jetty.server.ssl.SslSelectChannelConnector;
import org.eclipse.jetty.servlet.ServletHandler; import org.eclipse.jetty.servlet.ServletHandler;
import org.eclipse.jetty.servlet.ServletHolder; import org.eclipse.jetty.servlet.ServletHolder;
import org.eclipse.jetty.webapp.WebAppContext; import org.eclipse.jetty.webapp.WebAppContext;
import org.eclipse.jetty.util.log.Log;
import org.eclipse.jetty.util.resource.Resource; import org.eclipse.jetty.util.resource.Resource;
import org.eclipse.jetty.util.security.Constraint; import org.eclipse.jetty.util.security.Constraint;
import org.eclipse.jetty.util.security.Credential; import org.eclipse.jetty.util.security.Credential;
@ -75,6 +77,20 @@ import org.eclipse.jetty.util.thread.ThreadPool;
* Start the router console. * Start the router console.
*/ */
public class RouterConsoleRunner implements RouterApp { public class RouterConsoleRunner implements RouterApp {
static {
// 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 wrapper log");
}
// This way it doesn't try to load Slf4jLog first
// This causes an NPE in AbstractLifeCycle
// http://dev.eclipse.org/mhonarc/lists/jetty-users/msg02587.html
//System.setProperty("org.eclipse.jetty.util.log.class", "net.i2p.jetty.I2PLogger");
}
private final RouterContext _context; private final RouterContext _context;
private final ClientAppManager _mgr; private final ClientAppManager _mgr;
private volatile ClientAppState _state = UNINITIALIZED; private volatile ClientAppState _state = UNINITIALIZED;
@ -291,14 +307,6 @@ public class RouterConsoleRunner implements RouterApp {
if (!workDirCreated) if (!workDirCreated)
System.err.println("ERROR: Unable to create Jetty temporary work directory"); System.err.println("ERROR: Unable to create Jetty temporary work directory");
//try {
// Log.setLog(new I2PLogger(_context));
//} 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.eclipse.jetty.util.log.class", "net.i2p.jetty.I2PLogger");
// so Jetty can find WebAppConfiguration // so Jetty can find WebAppConfiguration
System.setProperty("jetty.class.path", _context.getBaseDir() + "/lib/routerconsole.jar"); System.setProperty("jetty.class.path", _context.getBaseDir() + "/lib/routerconsole.jar");
_server = new Server(); _server = new Server();

View File

@ -1,3 +1,10 @@
2013-04-14 zzz
* i2psnark:
- Set unique tunnel nickname for additional instances
- Increase page size to 50
* Jetty logging: Fix logging using I2PLogger class;
log ignored messages at debug level
2013-04-13 zzz 2013-04-13 zzz
* Console: Add /graph support for bw.combined, consolidate * Console: Add /graph support for bw.combined, consolidate
rendering code (ticket #890) rendering code (ticket #890)

View File

@ -25,7 +25,7 @@
<!-- eepsite on http://127.0.0.1:7657/configclients.jsp . --> <!-- eepsite on http://127.0.0.1:7657/configclients.jsp . -->
<!-- --> <!-- -->
<!-- Jetty now uses the I2P logging system rather than wrapper.log. --> <!-- Jetty now uses the I2P logging system rather than wrapper.log. -->
<!-- Use the log override org.mortbay.jetty.Server to adjust the log level. --> <!-- Use the log override org.eclipse.jetty.server.Server to adjust the log level. -->
<!-- --> <!-- -->
<!-- Note that the XML encoding for this file is UTF-8. --> <!-- Note that the XML encoding for this file is UTF-8. -->
<!-- --> <!-- -->

View File

@ -18,7 +18,7 @@ public class RouterVersion {
/** deprecated */ /** deprecated */
public final static String ID = "Monotone"; public final static String ID = "Monotone";
public final static String VERSION = CoreVersion.VERSION; public final static String VERSION = CoreVersion.VERSION;
public final static long BUILD = 3; public final static long BUILD = 4;
/** for example "-test" */ /** for example "-test" */
public final static String EXTRA = ""; public final static String EXTRA = "";