logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gary Gregory <garydgreg...@gmail.com>
Subject Re: adding log4j 2.x support to a library
Date Thu, 30 Apr 2015 16:43:42 GMT
On Thu, Apr 30, 2015 at 2:13 AM, Mikael Ståldal <mikael.staldal@magine.com>
wrote:

> Please don't make the library depend on log4j-core. A library should only
> depend on log4j-api and leave log configuration to the application using
> the library.
>
> And don't log too much from the library, there are too many libraries out
> there doing excessive logging.
>

That's silly IMO. Log4j gives user and developers great control over how
much shows up in logs with hierarchical loggers, levels and markers.

If a library chooses to use a single logger with a single level, well,
that's silly. But at least you can turn OFF that logger!

Unless the library uses the root logger... and that would be REALLY silly.

Gary


> On Wed, Apr 29, 2015 at 10:54 PM, Gary Gregory <garydgregory@gmail.com>
> wrote:
>
> > You can replace the log4j 1 jar with the log4j 2 compatiblity API. You'll
> > also need the log4j 2 API and Core modules.
> >
> > Please see https://logging.apache.org/log4j/2.x/manual/migration.html
> >
> > Gary
> >
> > On Wed, Apr 29, 2015 at 12:53 PM, Mike Calmus <mike@calmus.org> wrote:
> >
> > > We have some existing code that is used as a library by other projects.
> > > This code uses log4j 1.2. We would like to convert it to use log4j 2.x
> > but
> > > not remove support for 1.2 so that projects that have not yet migrated
> > can
> > > still see logging. Any thoughts on how this might be accomplished?
> > >
> > > Thanks.
> > >
> >
> >
> >
> > --
> > E-Mail: garydgregory@gmail.com | ggregory@apache.org
> > Java Persistence with Hibernate, Second Edition
> > <http://www.manning.com/bauer3/>
> > JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
> > Spring Batch in Action <http://www.manning.com/templier/>
> > Blog: http://garygregory.wordpress.com
> > Home: http://garygregory.com/
> > Tweet! http://twitter.com/GaryGregory
> >
>
>
>
> --
> [image: MagineTV]
>
>  *Mikael Ståldal*
> Senior backend developer
>
>  *Magine TV*
>  mikael.staldal@magine.com
>  Regeringsgatan 25  | 111 53 Stockholm, Sweden  |   www.magine.com
>
>  Privileged and/or Confidential Information may be contained in this
> message. If you are not the addressee indicated in this message
> (or responsible for delivery of the message to such a person), you may not
> copy or deliver this message to anyone. In such case,
> you should destroy this message and kindly notify the sender by reply
> email.
>



-- 
E-Mail: garydgregory@gmail.com | ggregory@apache.org
Java Persistence with Hibernate, Second Edition
<http://www.manning.com/bauer3/>
JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
Spring Batch in Action <http://www.manning.com/templier/>
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message