adding log4j 2.x support to a library

2015-04-29 Thread Mike Calmus
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.

Re: adding log4j 2.x support to a library

2015-04-29 Thread Douglas Wegscheid
two possibilities offhand: either continue to use the 1.2 API (which can be bridged to 2.x), or switch to logging to slf4j (which can be bridged to about anything). I'm sure that there are more possibilities. *■ DOUGLAS E. WEGSCHEID* // Lead Analyst, Directories (269) 923-5278 // douglas_e_wegsch

Re: adding log4j 2.x support to a library

2015-04-29 Thread Gary Gregory
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 l

Re: adding log4j 2.x support to a library

2015-04-30 Thread Mikael Ståldal
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. On Wed, Apr 29, 2015 at 10:54 PM

Re: adding log4j 2.x support to a library

2015-04-30 Thread Gary Gregory
On Thu, Apr 30, 2015 at 2:13 AM, Mikael Ståldal 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 ou