I don't know that it's possible, but I think it's moot. I'm going to suggest you just deprecate the Jetty logback-access module. They have a much cleaner interface now that does all the work of the logging for you, and they already use SLF4J when you convince it to, which is undocumented but intended to be supported. Instead of you needing to implement anything you just have to give their existing RequestLogImpl class an instance of their own built-in SLF4JWriter class. That allows the existing logback logging support to pick up request log events and route them however you configure. Works perfectly so far without any need to add more code. I think you just need to note that and move on. Less work for the win. This is all I needed (apart from setting up an appender and a logger with additivity=false in the main logback.xml file).
<!DOCTYPE Configure PUBLIC "- "https://www.eclipse.org/jetty/configure_10_0.dtd"><!-- =============================================================== -->
<!-- Configure the Jetty Request Log -->
<!-- =============================================================== -->
<Configure id="Server" class="org.eclipse.jetty.server.Server"> <!-- =========================================================== -->
<!-- Configure Request Log for Server -->
<!-- (Use RequestLogHandler for a context specific RequestLog -->
<!-- =========================================================== -->
<Set name="RequestLog">
<New id="RequestLog" class="org.eclipse.jetty.server.CustomRequestLog">
<!-- Writer -->
<Arg>
<New class="org.eclipse.jetty.server.Slf4jRequestLogWriter" />
</Arg> <!-- Format String -->
<Arg>
<Property name="jetty.requestlog.formatString" deprecated="jetty.customrequestlog.formatString">
<Default>
<Get class="org.eclipse.jetty.server.CustomRequestLog" name="EXTENDED_NCSA_FORMAT"/>
</Default>
</Property>
</Arg>
</New>
</Set>
</Configure>
|