You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The implementation that will be required can be seen in my local example: LogbackAccessLogAdapter.java which is configured in the logback-access.xml
In my example, I log to my application's SLF4J logger using the RequestLog logger name, and I also set a filter for ignoring unwanted access log items.
The bridge itself (AccessLogToMainLogAppender.java) goes round-the-houses by using an hacked OutputStream, but that means I can continue using Pattern layout encoders etc for config simplicity.
Anyway, it might be useful to your users so feel free to point at the gist or copy it to a wiki or whatever you like.
Rob
The text was updated successfully, but these errors were encountered:
robshep
changed the title
Tip: Logging via the main application Logback configuration
Tip: Logging via another logging system
May 10, 2018
Hi,
I didn't want to setup a new logfile destination - I just wanted to log via the application's main logging subsystem.
I have quickly hacked together a bridge that logs via another logger that can be simply constructed to suit any other logging provider.
Code is here: https://gist.github.com/robshep/918c9b6eb95fd740f11891e3a2ebc9ad
The implementation that will be required can be seen in my local example:
LogbackAccessLogAdapter.java
which is configured in thelogback-access.xml
In my example, I log to my application's
SLF4J
logger using theRequestLog
logger name, and I also set a filter for ignoring unwanted access log items.The bridge itself (
AccessLogToMainLogAppender.java
) goes round-the-houses by using an hacked OutputStream, but that means I can continue using Pattern layout encoders etc for config simplicity.Anyway, it might be useful to your users so feel free to point at the gist or copy it to a wiki or whatever you like.
Rob
The text was updated successfully, but these errors were encountered: