Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix request attribute-related race condition in Logback request logging #1678

Merged
merged 2 commits into from
Aug 9, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
public class AsyncLoggingEventAppenderFactory implements AsyncAppenderFactory<ILoggingEvent> {

/**
* Creates an {@link AsyncAppenderFactory} of type {@link ILoggingEvent}
* @return the {@link AsyncAppenderFactory}
* Creates an {@link AsyncAppenderBase} of type {@link ILoggingEvent}
* @return the {@link AsyncAppenderBase}
*/
@Override
public AsyncAppenderBase<ILoggingEvent> build() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,11 @@
public class AsyncAccessEventAppenderFactory implements AsyncAppenderFactory<IAccessEvent> {

/**
* Creates an {@link AsyncAppenderFactory} of type {@link IAccessEvent} that prepares events
* for deferred processing
* @return the {@link AsyncAppenderFactory}
* Creates an {@link AsyncAppenderBase} of type {@link IAccessEvent}.
* @return the {@link AsyncAppenderBase}
*/
@Override
public AsyncAppenderBase<IAccessEvent> build() {
return new AsyncAppenderBase<IAccessEvent>() {
@Override
protected void preprocess(IAccessEvent event) {
event.prepareForDeferredProcessing();
}
};
return new AsyncAppenderBase<IAccessEvent>();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please also update the Javadoc for this method? In looks a lit bit wrong for me.

  • It should link to AsyncAppenderBase rather than to AsyncAppenderFactory (not-related issue to this change)
  • I think we should remove a claim about deferred processing.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitely, thanks for mentioning. It would be nice to collapse this and io.dropwizard.logging.async.AsyncLoggingEventAppenderFactory into a single class parameterized on the type of event, since they're now almost identical. This would be a breaking change, though.

I took the liberty of updating AsyncLoggingEventAppenderFactory's Javadoc too, since it also incorrectly links to AsyncAppenderFactory.

}
}