I had a look at the code of log4j and here's what it does in the log method,
which you are calling:
---------------------
/**
This generic form is intended to be used by wrappers.
*/
public
void log(Priority priority, Object message) {
if(repository.isDisabled(priority.level)) {
return;
}
if(priority.isGreaterOrEqual(this.getEffectiveLevel()))
forcedLog(FQCN, priority, message, null);
}
--------------------------
And here's the implementation of priority.isGreaterOrEqual method:
/**
Returns <code>true</code> if this level has a higher or equal
level than the level passed as argument, <code>false</code>
otherwise.
<p>You should think twice before overriding the default
implementation of <code>isGreaterOrEqual</code> method.
*/
public
boolean isGreaterOrEqual(Priority r) {
return level >= r.level;
}
What's the integer value that you have given to your Level, that you created?
If this method returns false, then your message wont be logged to the file.
regards,
-Jaikiran
Boris Lipsman <[EMAIL PROTECTED]> wrote:
Hi,
This is what I have done:
Step1: Created MyLevelClass ( extends LEVEL ) with 2 extra levels declared
TRACE and METHOD_DEBUG_DETAILS
Step2: Created the wrapper around Logger ( log4j)
Step3: Added to the log4j.xml the following
Step4: Defined the category that referencing the appender
While, I start JBoss, all looks good, the trace level is beaing created(
I used to get before error messages that
com.mywebapp.logging.MyExtraLevel is not found. But that was fixed by adding
jar to the lib directory.
here is the scenario:
MyLogger myLogger = new MyLogger(SomeClass.class);
// MyLogger is a wrapper around Logger ( log4j)
myLogger.trace();
// trace() is actually calling generic log() method of the log4j
Strange thing, when I call the trace() method the message does not go
anywhere.
Please help
Boris
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------
Find out what India is talking about on Yahoo! Answers India.
So, whatÂ’s NEW about the NEW Yahoo! Messenger? Find out.