[slf4j-user] Leveraging Gradle to detect invalid logging setups

Louis Jacomet ljacomet at gmail.com
Mon Jan 20 15:07:35 CET 2020


Hello,

A couple months ago, Marshall Pierce announced [1] a plugin leveraging the
Gradle capabilities concept [2]. It allows Gradle to detect invalid logging
configurations involving Slf4J at build time.

Unfortunately, the Gradle dependency management team wasn't following this
list and missed the announcement about Marshall’s plugin. So we developed a
similar plugin [3] in parallel to writing a blog post on the Gradle blog
[4] that described the approach in detail.

Feature wise, the plugin goes a bit further than what Marshall’s plugin
offers, as it can for example detect invalid setups involving Log4J 2. In
addition, it offers configuration options to enforce a selected logging
solution if conflicts are detected.

If you use Gradle, take a look at the plugin as it will protect against
invalid setups out of the box. Please report issues or feature ideas on
GitHub [5].

The capabilities-based conflict detection in Gradle could also work without
plugins, if logging libraries such as Slf4j would publish enough
information in their metadata, which is now possible using the new Gradle
Module Metadata format (in addition to POM) [6]. We, at Gradle, would be
very happy to discuss, and help with, publishing this information for
upcoming Slf4J / Logback releases. Would there be an interest there (asking
Slf4J maintainers)?

Regards,
Louis for the Gradle Dependency Management team

[1] https://markmail.org/thread/e6qkwot66y64jn5g
[2] https://docs.gradle.org/6.0.1/userguide/component_capabilities.html
[3] https://plugins.gradle.org/plugin/dev.jacomet.logging-capabilities
[4] https://blog.gradle.org/addressing-logging-complexity-capabilities
[5] https://github.com/ljacomet/logging-capabilities
[6]
https://docs.gradle.org/current/userguide/publishing_gradle_module_metadata.html
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.qos.ch/pipermail/slf4j-user/attachments/20200120/37366d04/attachment.html>


More information about the slf4j-user mailing list