Hi,

I am using log4j, version 1.2.6 for logging. There are different server processes 
running on the machine. When the server is heavily loaded, that is more than one 
server process (service) running with a full load, log4j gets stuck at 
"callAppenders". 

Please see the thread status given below....

"Thread#23" prio=5 tid=0x4849d8 nid=0x49 waiting for monitor entry 
[0xa8f40000..0xa8f419e0]
at org.apache.log4j.Category.callAppenders(Category.java:186)
at org.apache.log4j.Category.forcedLog(Category.java:372)
at org.apache.log4j.Category.log(Category.java:846)

"Thread#10" prio=5 tid=0x2b8ee8 nid=0x3c waiting on monitor [0xa91b1000..0xa91b19e0]
at java.lang.Object.wait(Native Method)
at java.lang.Object.wait(Object.java:415)
at org.apache.log4j.AsyncAppender.append(AsyncAppender.java:85)
at org.apache.log4j.AppenderSkeleton.doAppend(AppenderSkeleton.java:221)
at 
org.apache.log4j.helpers.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:57)
at org.apache.log4j.Category.callAppenders(Category.java:187)
at org.apache.log4j.Category.forcedLog(Category.java:372)
at org.apache.log4j.Category.log(Category.java:846)

"Dispatcher-Thread-1" daemon prio=5 tid=0x605298 nid=0xf suspended 
[0xfa831000..0xfa8319e0]
at java.io.FileOutputStream.writeBytes(Native Method)
at java.io.FileOutputStream.write(FileOutputStream.java:207)
at java.io.OutputStreamWriter.flushBuffer(OutputStreamWriter.java:225)
at java.io.OutputStreamWriter.flush(OutputStreamWriter.java:239)
at org.apache.log4j.helpers.QuietWriter.flush(QuietWriter.java:49)
at org.apache.log4j.WriterAppender.subAppend(WriterAppender.java:306)
at org.apache.log4j.RollingFileAppender.subAppend(RollingFileAppender.java:225)
at org.apache.log4j.WriterAppender.append(WriterAppender.java:150)

Dispatcher thread is suspended. Since there is only one dispatcher available all log4j 
callAppenders are in waiting state. 

Has anybody come across a situation like this ? 
What is the workaround ? 

Please suggest if this is a log4j bug.

Other Info:
log4j buffer size is 128

thanks
- Srikanth


Inderdeep Dhir <[EMAIL PROTECTED]> wrote:Hi Scott,

Your debug log methods in LoggerWrapper should look like this...

public void debug(String categoryName, Object message) {
getCategory(categoryName).log(WRAPPER_FQN,Level.DEBUG,message,null);
}

public void debug(String categoryName, Object message, Throwable t) {
getCategory(categoryName).log(WRAPPER_FQN,Level.DEBUG,message,t);
}

Regards,
~ Inder

-----Original Message-----
From: Scott Burns [mailto:[EMAIL PROTECTED] 
Sent: Saturday, June 07, 2003 12:24 AM
To: Log4J Users List
Subject: RE: Calling method not showing


Thanks this has solved most of my issues.:) I have purchased the official doc but in 
the meantime one of the apps still is unable to resolve the method name. The others 
work fine and I see no difference in my setup. Any suggestions? Thanks again for the 
help and quick responses.

Scott

06 Jun 2003 14:44:02,288 [INFO] AutoCompleterLogger. - Log4j initialized using file 
:/AutoCompleter_log4j.properties 06 Jun 2003 14:44:02,328 [INFO] 
PropertiesAutoCompleter.? - Using property file :AutoCompleter.properties

public class LoggerWrapper {

protected final static String WRAPPER_FQN = LoggerWrapper.class.getName();
private Logger logger=null;
public LoggerWrapper(String filename){
init(filename,null);
}


public LoggerWrapper(String filename,String fqcname){
init(filename,fqcname);
}


private void init(String filename,String fqcname ) {
if (fqcname==null)
fqcname=WRAPPER_FQN;
Properties props = null;
try {
props = PropertiesUtils.loadAsResource(filename);
PropertyConfigurator.configure(props);
logger =Logger.getLogger(fqcname);
logger.log(WRAPPER_FQN,Level.INFO,"Log4j initialized using file :"+filename,null);


}catch(ConfigurationException ce){
getCategory(WRAPPER_FQN).error("log4j properties file '"+ filename +"' not found. It 
must be in the CLASSPATH");
System.out.println("log4j properties file '"+ filename +"' not found. It must be in 
the CLASSPATH");
}

}




public void debug(String categoryName, Object message) {
getCategory(categoryName).log(categoryName,Level.DEBUG,message,null);
}



public void debug(String categoryName, Object message, Throwable t) {
getCategory(categoryName).log(categoryName,Level.DEBUG,message,t);

}

Props from application log4j.category.com.blccpl.autocompleter=DEBUG,RR
log4j.appender.RR=org.apache.log4j.RollingFileAppender
log4j.appender.RR.File=d:/auto.log
log4j.appender.RR.layout=org.apache.log4j.PatternLayout
log4j.appender.RR.layout.ConversionPattern=%d{DATE} [%p] %c{1}.%M - %m%n 
log4j.appender.RR.MaxFileSize=5000KB
log4j.appender.RR.MaxBackupIndex=30


Props from wrapper

log4j.category.com.blccpl.connection=DEBUG, IC1 log4j.category.com.blccpl.log=DEBUG, 
IC1 log4j.category.com.blccpl.util=DEBUG, IC1 
log4j.appender.IC1=org.apache.log4j.RollingFileAppender
log4j.appender.IC1.File=d:/NewLog.log
log4j.appender.IC1.layout=org.apache.log4j.PatternLayout
log4j.appender.IC1.layout.ConversionPattern=%d{DATE} [%p] %c{1}.%M - %m%n 
log4j.appender.IC1.MaxFileSize=5000KB
log4j.appender.IC1.MaxBackupIndex=30


-----Original Message-----
From: Inderdeep Dhir [mailto:[EMAIL PROTECTED] 
Sent: Thursday, June 05, 2003 12:58 PM
To: Log4J Users List
Subject: RE: Calling method not showing


Hi Scott,

This has been covered in the list before. You can find more details at 
http://marc.theaimsgroup.com/?l=log4j-user&m=105360839727846&w=2

Regards,
~ Inder

-----Original Message-----
From: Scott Burns [mailto:[EMAIL PROTECTED] 
Sent: Thursday, June 05, 2003 10:17 PM
To: Log4J Users List
Subject: RE: Calling method not showing


Ceki, thanks for the advise. So I updated the wrapper to use Logger and am now using 
log4j-1.2.8.jar. I still get the same output? I probably did not fully understand your 
recommendation what did I miss. thanks

Scott

protected org.apache.log4j.Category getCategory(String categoryName) {
return org.apache.log4j.Logger.getInstance(categoryName);
}

05 Jun 2003 11:40:59,527 [DEBUG] requestHandler.debug - [PID :13082] SEECHook 
requestHandler completed request ...

-----Original Message-----
From: Ceki Gülcü [mailto:[EMAIL PROTECTED] 
Sent: Thursday, June 05, 2003 8:52 AM
To: Log4J Users List
Subject: Re: Calling method not showing


Scott,

In you wrapper, you call use the generic Category.log(
String 
callerFQCN,
<../../../org/apache/log4j/Priority.htm>Priority level,
Object 
message,
Throwable 
t) method.

At 08:19 AM 6/5/2003 -0400, you wrote:
>I inhertied a project that is using log4j. A framework was added that
>wraps log4j and now the method is no longer visible in the output. I 
>get back the log4j wrapper method. How can I get back the calling 
>method?
>
>Scott

--
Ceki For log4j documentation consider "The complete log4j manual"
ISBN: 2970036908 http://www.qos.ch/shop/products/clm_t.jsp 


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


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


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


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


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





---------------------------------
Yahoo! Plus - For a better Internet experience

Reply via email to