-
Notifications
You must be signed in to change notification settings - Fork 125
Added Maven dependency example #57
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -65,9 +65,56 @@ recommended Java logging API within Google. | |
|
|
||
| ### 1. Add the dependencies on Flogger | ||
|
|
||
| All code that uses flogger should depend on | ||
| `com.google.flogger:flogger:<version>` and | ||
| `com.google.flogger:flogger-system-backend:<version>`. | ||
| All code that uses flogger should depend on: | ||
|
|
||
| * `com.google.flogger:flogger:<version>` | ||
| * `com.google.flogger:flogger-system-backend:<version>` | ||
|
|
||
| **Maven** | ||
|
|
||
| ```xml | ||
| <dependency> | ||
| <groupId>com.google.flogger</groupId> | ||
| <artifactId>flogger</artifactId> | ||
| <version>${flogger.version}</version> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>com.google.flogger</groupId> | ||
| <artifactId>flogger-log4j-backend</artifactId> | ||
| <version>${flogger.version}</version> | ||
| <scope>runtime</scope> | ||
| </dependency> | ||
| ``` | ||
|
|
||
| Optionally | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you please describe in what circumstances one would want to add the explicit dependency on log4j/exclusions? If I'm reading this directly, I don't know why/when I would do this instead of the first example above. If the explanation is long enough, perhaps a footnote would help?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @nglorioso I don't know / remember. Flogger wasted more time than it saved to the point where we ended up debugging JUL in tears. It manages to take something that typically causes problems (e.g. slf4j + X) and compounds that complexity into something more difficult. I'm not sure it's worth the trouble. I may be too stupid / ignorant to actually figure it out. Currently have to do static blocks like to get it working but for some reason this PR is still open... Here's how the dependency management section looks like |
||
|
|
||
| ```xml | ||
| <dependency> | ||
| <groupId>com.google.flogger</groupId> | ||
| <artifactId>flogger-log4j-backend</artifactId> | ||
| <version>${google.flogger.version}</version> | ||
| <scope>runtime</scope> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>log4j</groupId> | ||
| <artifactId>log4j</artifactId> | ||
| <version>${log4j.version}</version> | ||
| <exclusions> | ||
| <exclusion> | ||
| <groupId>com.sun.jmx</groupId> | ||
| <artifactId>jmxri</artifactId> | ||
| </exclusion> | ||
| <exclusion> | ||
| <groupId>com.sun.jdmk</groupId> | ||
| <artifactId>jmxtools</artifactId> | ||
| </exclusion> | ||
| <exclusion> | ||
| <groupId>javax.jms</groupId> | ||
| <artifactId>jms</artifactId> | ||
| </exclusion> | ||
| </exclusions> | ||
| </dependency> | ||
| ``` | ||
|
|
||
| > Note: the dependency on `flogger-system-backend` is only required to be | ||
| included when the binary is run. If you have a modularized build, you can | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be helpful to move the NOTE from below to above the Maven subheading and add inline XML comments like:
<!-- only in root component of your application -->above
flogger-log4j-backend