You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by jwboring <jb...@impulse.com> on 2006/11/17 17:38:32 UTC

Realtime notification of ThreadPool logFull

I need to be notified when ever a Tomcat v5.5 server is over the threadpool
limit. I am already monitoring log4j log messages but the logFull message
appears to me to be a System.out log, by-passing log4j (catalina.out text
shown below).

Nov 17, 2006 12:08:25 PM org.apache.tomcat.util.threads.ThreadPool logFull
SEVERE: All threads (10) are currently busy, waiting. Increase maxThreads

If my above assumption is correct, how can I monitor ThreadPool logFull
messages without reading the catalina.out file and parsing? Also, I'm aware
of the ThreadPool mbean and already use JMX to query this mbean to display
it's properties. However, I don't believe this mbean supports JMX
notifications. Of course, I could spawn a thread every X minutes but that
seems dumb. Can I do this with a LifeCycle Listener? Is there a way to get
log4j messages e.g., log.error("logFull SEVERE: All threads ...") from the
ThreadPool object?

Jeff
-- 
View this message in context: http://www.nabble.com/Realtime-notification-of-ThreadPool-logFull-tf2654425.html#a7405640
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Realtime notification of ThreadPool logFull

Posted by jwboring <jb...@impulse.com>.

jwboring wrote:
> 
> the logFull message appears to me to be a System.out log, by-passing log4j 
> 

OK, Tomcat uses java logging by default. All I have to do is configure log4j
- see http://tomcat.apache.org/tomcat-5.5-doc/logging.html
-- 
View this message in context: http://www.nabble.com/Realtime-notification-of-ThreadPool-logFull-tf2654425.html#a7445175
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Realtime notification of ThreadPool logFull

Posted by jwboring <jb...@impulse.com>.

Martin Gainty wrote:
> 
> your diagnostic appears out of sync with your source. where did you
> acquire the source?
> 

The app is deployed under the the binary distribution gotten from the web
site (http://tomcat.apache.org/download-55.cgi). We do not compile from the
source, at least not yet. I only got the source to check the log code.
Source came from the archives
(http://archive.apache.org/dist/tomcat/tomcat-5/v5.5.17/). Can anyone
explain the log message I am getting that does not appear to be to commons
log? 

I'll install v5.5.20 Monday from binary and see if I get the same strange
log.

Jeff
-- 
View this message in context: http://www.nabble.com/Realtime-notification-of-ThreadPool-logFull-tf2654425.html#a7424775
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Realtime notification of ThreadPool logFull

Posted by Martin Gainty <mg...@hotmail.com>.
your diagnostic appears out of sync with your source
where did you acquire the source?
M-
This e-mail communication and any attachments may contain confidential and privileged information for the use of the 
designated recipients named above. If you are not the intended recipient, you are hereby notified that you have received
this communication in error and that any review, disclosure, dissemination, distribution or copying of it or its 
contents
----- Original Message ----- 
From: "jwboring" <jb...@impulse.com>
To: <us...@tomcat.apache.org>
Sent: Saturday, November 18, 2006 9:27 AM
Subject: RE: Realtime notification of ThreadPool logFull


> 
> 
> Nelson, Tracy wrote:
>> Why not just grab the source
> 
> I looked at the source (org.apache.tomcat.util.threads.ThreadPool) and it IS
> logging to the commons logger - see below.
> 
> private static void logFull(Log loghelper, int currentThreadCount,
>                                int maxThreads) {
> if( logfull ) {
>            log.error(sm.getString("threadpool.busy",
>                                   new Integer(currentThreadCount),
>                                   new Integer(maxThreads)));
>            logfull=false;
>        } else if( log.isDebugEnabled() ) {
>            log.debug("All threads are busy " + currentThreadCount + " " +
>                      maxThreads );
>        }
>    }
> 
> 
> But this is NOT the log I am getting in catalina.out. Instead, I am getting,
> "Nov 17, 2006 12:08:25 PM org.apache.tomcat.util.threads.ThreadPool logFull
> SEVERE: All threads (10) are currently busy, waiting. Increase maxThreads."
> What gives? I am getting other normal info, etc ... level messages but not
> this one. Using v5.5.17.
> 
> Jeff
> -- 
> View this message in context: http://www.nabble.com/Realtime-notification-of-ThreadPool-logFull-tf2654425.html#a7419824
> Sent from the Tomcat - User mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
>

Re: Realtime notification of ThreadPool logFull

Posted by Rainer Jung <ra...@kippdata.de>.
Hi Jeff,

jwboring schrieb:
> private static void logFull(Log loghelper, int currentThreadCount,
>                                 int maxThreads) {
> 	if( logfull ) {
>             log.error(sm.getString("threadpool.busy",
>                                    new Integer(currentThreadCount),
>                                    new Integer(maxThreads)));

Most likely this is the one you are interested in!

>             logfull=false;
>         } else if( log.isDebugEnabled() ) {
>             log.debug("All threads are busy " + currentThreadCount + " " +
>                       maxThreads );
>         }
>     }
> 
> 
> But this is NOT the log I am getting in catalina.out. Instead, I am getting,
> "Nov 17, 2006 12:08:25 PM org.apache.tomcat.util.threads.ThreadPool logFull
> SEVERE: All threads (10) are currently busy, waiting. Increase maxThreads."
> What gives? I am getting other normal info, etc ... level messages but not
> this one. Using v5.5.17.
> 
> Jeff

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Realtime notification of ThreadPool logFull

Posted by jwboring <jb...@impulse.com>.

Nelson, Tracy wrote:
> Why not just grab the source

I looked at the source (org.apache.tomcat.util.threads.ThreadPool) and it IS
logging to the commons logger - see below.

private static void logFull(Log loghelper, int currentThreadCount,
                                int maxThreads) {
	if( logfull ) {
            log.error(sm.getString("threadpool.busy",
                                   new Integer(currentThreadCount),
                                   new Integer(maxThreads)));
            logfull=false;
        } else if( log.isDebugEnabled() ) {
            log.debug("All threads are busy " + currentThreadCount + " " +
                      maxThreads );
        }
    }


But this is NOT the log I am getting in catalina.out. Instead, I am getting,
"Nov 17, 2006 12:08:25 PM org.apache.tomcat.util.threads.ThreadPool logFull
SEVERE: All threads (10) are currently busy, waiting. Increase maxThreads."
What gives? I am getting other normal info, etc ... level messages but not
this one. Using v5.5.17.

Jeff
-- 
View this message in context: http://www.nabble.com/Realtime-notification-of-ThreadPool-logFull-tf2654425.html#a7419824
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org