Fix - mute Jetty

Fix for #159

Jetty logger not always is StdErrLog can be eg. Slf4jLog
This commit is contained in:
Slawomir Jaranowski 2022-05-18 19:21:31 +02:00
parent 2ea97ba825
commit c2d9fff607
1 changed files with 6 additions and 1 deletions

View File

@ -12,6 +12,7 @@ import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.ServerConnector;
import org.eclipse.jetty.server.handler.AbstractHandler;
import org.eclipse.jetty.util.log.Log;
import org.eclipse.jetty.util.log.Logger;
import org.eclipse.jetty.util.log.StdErrLog;
import org.eclipse.jetty.util.security.Constraint;
import org.eclipse.jetty.util.security.Password;
@ -40,7 +41,11 @@ public class HttpServer
{
static {
Log.initialized();
((StdErrLog) Log.getRootLogger()).setLevel( StdErrLog.LEVEL_WARN );
Logger rootLogger = Log.getRootLogger();
if ( rootLogger instanceof StdErrLog )
{
( (StdErrLog) rootLogger ).setLevel( StdErrLog.LEVEL_WARN );
}
}
private final Server server;