| Author |
y this ClassCastException in log4j ?
|
Sangeetha Rao
Greenhorn
Joined: Jul 26, 2005
Posts: 1
|
|
|
I have a class called MyApp in LoggerPkg package. It has this line: private final static MyLogger logger =(MyLogger) MyLogger.getLogger(MyApp.class.getName()); MyLogger extends Logger.It has getLogger method that returns Logger object based on the LoggerFactory object. Now in the properties file if I have this line: "log4j.logger.LoggerPkg.MyApp=debug, A1" it shows the exception java.lang.ClassCastException on the line in MyApp. If I have only the rootLogger in the properties file, I dont get this Exception. Can anybody say y ASAP??
|
 |
Carol Enderlin
drifter
Ranch Hand
Joined: Oct 10, 2000
Posts: 1348
|
|
I haven't tried it, but I found a note in log4j example src MyLoggerTest.java to try config files mycat.bad and mycat.good. mycat.good snippet:
|
 |
Sangeetha Rao
Ranch Hand
Joined: Aug 01, 2005
Posts: 33
|
|
|
Thanks Carol...can u plz give me a link to mycat.bad file !!
|
 |
Carol Enderlin
drifter
Ranch Hand
Joined: Oct 10, 2000
Posts: 1348
|
|
In my log4j 1.2.9 dir "logging-log4j-1.2.9" it's in the examples directory. mycat.bad: mycat.good:
|
 |
Sangeetha Rao
Ranch Hand
Joined: Aug 01, 2005
Posts: 33
|
|
Thanks a lott Carol
|
 |
 |
|
|
subject: y this ClassCastException in log4j ?
|
|
|