AsyncAppenderFactory discoverable: issue #2893

17 views
Skip to first unread message

Jeff Alder

unread,
Aug 31, 2019, 2:46:02 PM8/31/19
to dropwizard-dev
Hello,

I am working on a logging extension to dropwizard's logging. I've submitted https://github.com/dropwizard/dropwizard/issues/2893. Copying here for context:

I would like to decorate my logs with some data in MDC that needs to be captured synchronously at the time of logging. Namely - open tracing IDs.

In logback-classic, the user can configure the async appender in XML, so I don't have to do anything special there.

In Dropwizard 1.3, all appenders seem to be async, but the AsyncAppenderFactory doesn't inherit from Discoverable and doesn't appear to be injectable via configuration. In order to use my AsyncAppender, I have to derive from each individual AppenderFactory and override wrapAsync to use my AppenderFactory.

I would like to open a PR that would:

  1. Make AsyncAppenderFactory inherit from Discoverable
  2. Add a configuration parameter under logging that would support setting this (similar to LayoutFactory and AppenderFactory instances today).
  3. Use AsyncLoggingEventAppenderFactory by default if not configured

I'm open to:

  • Being wrong; I may have missed something when reading the code
  • Other ways of implementing this; Discoverable seems to be the consistent pattern
  • The name and placement of the config parameter in logging
  • Whether or not this would apply to the request logs (my default is no, since request logs are typically very specific and rarely customized as much).
  • The JsonTypeName applied to the default AsyncLoggingEventAppenderFactory

I plan to start working on this shortly. Is there any discussion that should happen on this list prior to diving in?

Thanks,
Jeff 
Reply all
Reply to author
Forward
0 new messages