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

Use of PluginBuilderFactory on AmqpAppender (Log4j2) #1144

Merged
merged 6 commits into from
Jan 21, 2020

Conversation

Scip88
Copy link
Contributor

@Scip88 Scip88 commented Jan 16, 2020

resolves #1142

Refactor "@ PluginFactory" and use of "@ PluginBuilderFactory"

Use of PluginBuilderFactory simplifies subclasses' implementations of AmqpAppender (Log4j2)

Refactor @pluginfactory and use of @PluginBuilderFactory

Simplify subclasses implementation of AmqpAppender (Log4j2)
@pivotal-issuemaster
Copy link

@Scip88 Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

@pivotal-issuemaster
Copy link

@Scip88 Thank you for signing the Contributor License Agreement!

@artembilan
Copy link
Member

@Scip88 ,

Thank you for contribution!

Use of PluginBuilderFactory simplifies subclasses' implementations of AmqpAppender

Would you mind to demonstrate such a feature in the tests? For example, AmqpAppenderTests is aimed for an AmqpAppender coverage.

Also, it sounds like Docs (logging.adoc) deserves some attention with this change...

@Scip88
Copy link
Contributor Author

Scip88 commented Jan 17, 2020

@artembilan,
no new test are needed, this is a refactor and tests from the same AmqpAppenderTest class from package org.springframework.amqp.rabbit.log4j2 are sufficient.

As indicated in Plugin Builder, the Log4j2 core initializes an Appender (as other log4j plugin) via two possible static methods: @PluginBuilderFactory or @PluginFactory

I'm working on logging.adoc

Add Example for Log4j2 subclasses and static factor
@Scip88
Copy link
Contributor Author

Scip88 commented Jan 17, 2020

@artembilan I've update logging.adoc, please take a look

@artembilan
Copy link
Member

no new test are needed

Then why do we do this change at all?
Seems for me you have claimed that with a @PluginBuilderFactory it is going to be easier to extend an AmqpAppender functionality.
So, confirm with a test, please, that we are good to go with the fix.

Thanks

Copy link
Member

@artembilan artembilan left a comment

Choose a reason for hiding this comment

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

Here is some review from me.
Great job anyway! I wish I didn't miss this builder option in the beginning so we wouldn't have that embarrassing message in the docs that Log4J appender cannot be extended. 😄

I'm still waiting for test to cover a new cool functionality.

Thank you very much!

src/reference/asciidoc/logging.adoc Show resolved Hide resolved
src/reference/asciidoc/logging.adoc Outdated Show resolved Hide resolved
src/reference/asciidoc/logging.adoc Outdated Show resolved Hide resolved
Copy link
Contributor Author

@Scip88 Scip88 left a comment

Choose a reason for hiding this comment

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

I have done the fix

Copy link
Member

@artembilan artembilan left a comment

Choose a reason for hiding this comment

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

I think I'm good with this.
Thanks.

@garyrussell , any objections from your side?

@garyrussell garyrussell merged commit abc96cf into spring-projects:master Jan 21, 2020
@garyrussell
Copy link
Contributor

@Scip88 Thanks for the contribution! Looking forward to more.

@artembilan Thanks for the review.

@Scip88 Scip88 deleted the GH-1142 branch January 21, 2020 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PluginBuilderFactory instead of PluginFactory for Log4j2 Appender
4 participants