Return-Path: X-Original-To: apmail-logging-log4j-user-archive@www.apache.org Delivered-To: apmail-logging-log4j-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 850F217FF7 for ; Thu, 30 Apr 2015 16:44:54 +0000 (UTC) Received: (qmail 52170 invoked by uid 500); 30 Apr 2015 16:44:54 -0000 Delivered-To: apmail-logging-log4j-user-archive@logging.apache.org Received: (qmail 52119 invoked by uid 500); 30 Apr 2015 16:44:54 -0000 Mailing-List: contact log4j-user-help@logging.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Log4J Users List" Reply-To: "Log4J Users List" Delivered-To: mailing list log4j-user@logging.apache.org Received: (qmail 52108 invoked by uid 99); 30 Apr 2015 16:44:54 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 30 Apr 2015 16:44:54 +0000 X-ASF-Spam-Status: No, hits=3.2 required=5.0 tests=HTML_MESSAGE,SPF_SOFTFAIL X-Spam-Check-By: apache.org Received-SPF: softfail (nike.apache.org: transitioning domain of garydgregory@gmail.com does not designate 54.76.25.247 as permitted sender) Received: from [54.76.25.247] (HELO mx1-eu-west.apache.org) (54.76.25.247) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 30 Apr 2015 16:44:29 +0000 Received: from mail-wi0-f171.google.com (mail-wi0-f171.google.com [209.85.212.171]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with ESMTPS id CC0112D199 for ; Thu, 30 Apr 2015 16:44:27 +0000 (UTC) Received: by widdi4 with SMTP id di4so24842894wid.0 for ; Thu, 30 Apr 2015 09:43:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=I5sjoQ5O5WTSMUFttewDQeCUodYoa5MSAGHGgYBRYbs=; b=iTpFqXTHREeaV5LwjBhl4V8OYkj3jVDYbvzcSMK7uzh9X3P1/myBCvjlDTYqp33tw0 b5l11ZFv1KaZ2QG4YOOOvK/GIezXYD+lsr9lqpIkhbn4WM+RM23qdHk51ma5QJ7yR53L JGgN1AaMfltsCoPih6VjTGH/MSO+gZZ/1L7r0RQgig3DOTAiiKayjTt//qBSi1ckHTy0 Q3MibIlaBfGAbIwmyd/pSkb/iptUwQeALuiX9jy2FYfK9pbFU+naMCpb0AkkkA9RAWyz wODq9wT6tYo3r9t8ox6cu23+yddyFsxVuwfYcVFoIih+A304OqRxU6fmRRbtsV5rglRv yPgg== MIME-Version: 1.0 X-Received: by 10.181.29.36 with SMTP id jt4mr4379365wid.21.1430412222594; Thu, 30 Apr 2015 09:43:42 -0700 (PDT) Received: by 10.27.83.211 with HTTP; Thu, 30 Apr 2015 09:43:42 -0700 (PDT) In-Reply-To: References: Date: Thu, 30 Apr 2015 09:43:42 -0700 Message-ID: Subject: Re: adding log4j 2.x support to a library From: Gary Gregory To: Log4J Users List Content-Type: multipart/alternative; boundary=001a113301926900ae0514f3cc92 X-Virus-Checked: Checked by ClamAV on apache.org --001a113301926900ae0514f3cc92 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Thu, Apr 30, 2015 at 2:13 AM, Mikael St=C3=A5ldal 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 > 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 wrote: > > > > > We have some existing code that is used as a library by other project= s. > > > 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 migrate= d > > 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 > > > > JUnit in Action, Second Edition > > Spring Batch in Action > > Blog: http://garygregory.wordpress.com > > Home: http://garygregory.com/ > > Tweet! http://twitter.com/GaryGregory > > > > > > -- > [image: MagineTV] > > *Mikael St=C3=A5ldal* > 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 no= t > copy or deliver this message to anyone. In such case, > you should destroy this message and kindly notify the sender by reply > email. > --=20 E-Mail: garydgregory@gmail.com | ggregory@apache.org Java Persistence with Hibernate, Second Edition JUnit in Action, Second Edition Spring Batch in Action Blog: http://garygregory.wordpress.com Home: http://garygregory.com/ Tweet! http://twitter.com/GaryGregory --001a113301926900ae0514f3cc92--