Ceki,

We posted the symptom last Friday on the Jonas forum but no one seems to
have run into the problem at this point.  I will post the "changes
between log4j..." you included to the Jonas group and see what kind of
response I get and let you know.

Thanks for the reply,
Bill

-----Original Message-----
From: Ceki Gülcü [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 01, 2002 3:55 PM
To: Log4J Users List; [EMAIL PROTECTED]
Subject: Re: Jonas 2.4.4 and log4j 1.2beta incompatibility


Hello William,

Changes between log4j version 1.1.x and 1.2

Log4j version 1.2 introduced many changes. In most cases, it can be
considered as a drop in replacement for log4j version 1.1.x. This
section discusses the changes and backward compatibility issues.

Logger replaces Category
------------------------

The most important change in 1.2 is the replacement of the Category
class with the Logger class. To preserve backward compatibility, the
Logger class extends the Category class such that it is always
possible to use a logger object where a category object is
expected. In addition, whenever log4j is asked to produce a Category
object, it will instead produce a Logger object. Methods that
previously accepted category objects will continue to accept them.

For example, the following are all legal and will work as expected.
       // Deprecated forms:
       Category cat = Category.getInstance("foo.bar")
       Logger logger = Logger.getInstance("foo.bar")
       Category cat = Logger.getLogger("foo.bar")

       // Preferred form for retrieving loggers:
       Logger logger = Logger.getLogger("foo.bar")

There is absolutely no need for new client code to use or refer to the
Category class in newly written code. Please avoid referring to it or
using it. It is important to note that the introduction of the Logger
class is backward compatible. You can still use the older Category
class in your existing code, just avoid writing new code using it.

You may contend that having Logger extend Category is unintuitive --
in particular because the Logger class is almost empty and relies
entirely on the Category class for its implementation. Don't be fooled
by the appearances. The Category class will eventually be removed and
most of its contents transferred to Logger.

Compatibility issues with Category sub-classes
----------------------------------------------

For most users the introduction of the Logger class is fully backward
compatible. However, if you have sub-classed the Category class, then
you need to heed the following points.

         Sub-classes of Category must extend org.apache.log4j.Logger
and not org.apache.log4j.Category.

         The org.apache.log4j.spi.CategoryFactory class has been
removed. It has been replaced with the
org.apache.log4j.spi.LoggerFactory class. Thus, your sub-class'
factory must be of type LoggerFactory.

         The Category.getInstance(String, CategoryFactory) method has
been removed. You need to invoke the LogManager.getLogger(String,
LoggerFactory) method to create loggers of your subclass type.

         In configuration scripts parsed by PropertyConfigurator the
log4j.categoryFactory keyword has been replaced with
log4j.loggerFactory.

========================================================
We also strongly recommend against sub-classing Logger (or Category)
to introduce new printing methods, you can use the general purpose
log(Level level, Object message) method instead.
========================================================

The problem you mention with Jonas is clearly related to the
sub-classing
problem mentioned above. Can you please report this to the Jonas people
and let us know how the developers there react? Thank you in advance.

At 15:15 01.04.2002 -0600, [EMAIL PROTECTED] wrote:
>We downloaded the latest version of Jonas 2.4.4 that uses log4j v1.0.4
>set of API's.
>
>We are using the log4j 1.2 beta exclusively and when I put the log4j
1.2
>beta jar file in front of the class path, Jonas throws a
>java.lang.NoSuchMethodError at
>org.objectweb.monolog.wrapper.log4j.MonologCategory.getInstance(Monolog
C
>ategory.java:25).
>
>Turns out that the method
>   Category getInstance(String name, CategoryFactory factory)
>that the Jonas log4j wrapper uses has been deprecated in the beta
>version of log4j.
>
>I guess I can decompile all of the Jonas's log4j wrapper classes and
>rewrite but that sounds a bit extreme for such a global problem.
>
>I thought that log4j beta was supposed to be backwards compatible.
>
>Has anyone else experienced this or have a solution to the problem?

--
Ceki
My link of the month: 
http://www.suntimes.com/output/otherviews/cst-edt-ref31.html


--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to