Hi all,
I am having a problem with log4j in combination with commons-logging.
I want to divide between error logging for finding bugs and business
logging for protocolling some special actions of my users.
Therefore I want to have an own logger with an own appender, thus my
business entries are written into only one own file without written any
error messages into it.
And I don't wanted the business messages to be logged as errors or
warnings, but I want them to be logged even if my log level is very high
(e.g. only fatal and errors).
Thus I implemented an own logger and an oen business level (between error
and fatal). And I also implemented an own LevelMatchFilter class.
Doing this all my business messages are going to file a, and all other to
file b. This works, but as the levelToMatch and the matchOccured attributes
are not public but package-wide, I had to write my class as
org.apache.log4J.varia.BusinessLevelMatchFilter. And I did not pack it into
the log4j.jar, but into my jar.
All this works fine. But when I put the commons-logging.jar into my
classpath, I get the following error message:
java.lang.IllegalAccessError:
org.apache.log4j.varia.BusinessLevelMatchFilter tried to access field
org/apache/log4j/varia/LevelMatchFilter.levelToMatch from class
at
org.apache.log4j.varia.BusinessLevelMatchFilter.setLevelToMatch(BusinessLevelMatchFilter.java:67)
at my.BusinessLogger.prepareAppender(BusinessLogger.java:53)
at my.BusinessLogger.getLogger(BusinessLogger.java:86)
at at my.MyBean.<clinit>(MyBean.java:29).null(Unknown Source)
....
Any Ideas how to solve my problem?
Thanks a lot for help in advance
Herb
--
Diese E-Mail enth�lt vertrauliche und/oder rechtlich gesch�tzte
Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail
irrt�mlich erhalten haben, informieren Sie bitte sofort den Absender und
vernichten Sie diese E-Mail. Das unerlaubte Kopieren sowie die unbefugte
Weitergabe dieser Mail oder von Teilen dieser Mail ist nicht gestattet.
Wir haben alle verkehrs�blichen Ma�nahmen unternommen, um das Risiko der
Verbreitung virenbefallener Software oder E-Mails zu minimieren, dennoch
raten wir Ihnen, Ihre eigenen Virenkontrollen auf alle Anh�nge an dieser
Nachricht durchzuf�hren. Wir schlie�en au�er f�r den Fall von Vorsatz oder
grober Fahrl�ssigkeit die Haftung f�r jeglichen Verlust oder Sch�den durch
virenbefallene Software oder E-Mails aus.
Jede von der Bank versendete E-Mail ist sorgf�ltig erstellt worden, dennoch
schlie�en wir die rechtliche Verbindlichkeit aus; sie kann nicht zu einer
irgendwie gearteten Verpflichtung zu Lasten der Bank ausgelegt werden.
______________________________________________________________________
This e-mail may contain confidential and/or privileged information. If you
are not the intended recipient (or have received this e-mail in error)
please notify the sender immediately and destroy this e-mail. Any
unauthorised copying, disclosure or distribution of the material in this
e-mail or of parts hereof is strictly forbidden.
We have taken precautions to minimize the risk of transmitting software
viruses but nevertheless advise you to carry out your own virus checks on
any attachment of this message. We accept no liability for loss or damage
caused by software viruses except in case of gross negligence or willful
behaviour.
Any e-mail messages from the Bank are sent in good faith, but shall not be
binding or construed as constituting any kind of obligation on the part of
the Bank.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]