- Jun 6, 2020
- 11,593
- 4,507
Im using a library that included slf4j as a dependency. What Ive noticed is that when I include this library my (Jetty) Server starts logging at the debug level.
According to the Jetty documentation documentation this is expected;
If the class org.slf4j.Logger exists in server classpath, the Jetty implementation becomes org.eclipse.jetty.util.log.Slf4jLog.
The fix is to force the jetty logging implementation back to StdErrLog, which you can do by setting the following in the jetty-logging.properties file like this;
org.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.StdErrLog
What Im after is a way to do this via code.
Ive tried several variations of this via JavaObject but I cant get it to work (code below give an error java.lang.RuntimeException: Field: org.eclipse.jetty.util.log.class not found in: anywheresoftware.b4j.object.ServerWrapper)
B4X:
According to the Jetty documentation documentation this is expected;
If the class org.slf4j.Logger exists in server classpath, the Jetty implementation becomes org.eclipse.jetty.util.log.Slf4jLog.
The fix is to force the jetty logging implementation back to StdErrLog, which you can do by setting the following in the jetty-logging.properties file like this;
org.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.StdErrLog
What Im after is a way to do this via code.
Ive tried several variations of this via JavaObject but I cant get it to work (code below give an error java.lang.RuntimeException: Field: org.eclipse.jetty.util.log.class not found in: anywheresoftware.b4j.object.ServerWrapper)
B4X:
کد:
محتوای بلوک کدها در دسترس شما نیست. برای مشاهده بلوک کدها، وارد انجمن شوید یاثبت نام کنید
برای دیدن لینک ها باید ثبت نام کنید
برای دیدن لینک ها باید ثبت نام کنید