Hi,

+1 for JUL, it is the most portable and less intrusive solution since it is
built-in, graalvm friendly (mvnd) and any backend compatible (slf4j,
logback directly, log4j2, ...).
It is always a pity for a solution which can embedded user code -
mojo/extensions - to force a logging library IMHO since it is never the
right one or the right version.

Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<https://www.packtpub.com/application-development/java-ee-8-high-performance>


Le ven. 4 nov. 2022 à 12:12, Gary Gregory <garydgreg...@gmail.com> a écrit :

> And let's not forget that Log4j also is a facade API:
> https://logging.apache.org/log4j/2.x/manual/api-separation.html
>
> Gary
>
>
> On Fri, Nov 4, 2022, 06:56 Slawomir Jaranowski <s.jaranow...@gmail.com>
> wrote:
>
> > Hi,
> >
> > I want to start ( again :-) ) a discussion about logging in Maven
> plugins.
> >
> > First I agree that plugin developers should use logging methods provided
> by
> > Plugin api.
> >
> > But we can not expect plugin developers to write everything from scratch.
> > In many cases they may want to use an external library to do tasks needed
> > by the plugin.
> >
> > We don't have any control over what logging framework is used in the
> > external library used by plugin developers.
> >
> > We also maintain some libraries which can be used by plugin and also as
> > standalone in another project.
> > In such a case the question is - what logging we should use [1]?
> >
> > Last time I did a test, I use Java util logging from JDK in the Maven
> > plugin.
> > I see that Java util logging use default configuration, eg. we will have
> > two lines for one log event.
> > Even more options -q and -X have no effect for such a logger.
> >
> > One of the solution for such problem is using "Bridging" methods
> supported
> > by slf4j [2]
> > Probably all of existing and future logging frameworks can not be
> covered -
> > but most of common using will be.
> >
> > I hope that, even if we will want to change the logging framework used
> > internally in Maven, we can also use the same method.
> >
> > [1] https://github.com/apache/maven-dependency-analyzer/pull/71
> > [2] https://www.slf4j.org/legacy.html
> >
> >
> > --
> > Sławomir Jaranowski
> >
>

Reply via email to