You could write a Perl script that runs between your Java app and the
filesystem.  Output would normally go to the file they're going to now,
but if it sees something that looks like a thread dump it could put that
output into a dump file.
  -M@

--
Matt Hixson
Aventail Corporation
Seattle, Washington
www.aventail.com

On Thu, 30 Aug 2001, Gene Chuang wrote:

> Herein lies the problem:  we already redirect stdout to a logfile, so we see
> a lot of app server logging and System.outs in this file.  I was hoping to
> write a script that:
>
> 1) finds process of errant server
> 2) kill -3
> 3) redirect thread dump to a new (different) file for easier access
>
> Gene Chuang
> Kiko.com
>
>
> -----Original Message-----
> From: Matthew Hixson [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, August 30, 2001 10:29 AM
> To: Gene Chuang
> Cc: [EMAIL PROTECTED]
> Subject: Re: How to find process id of a java process?
>
>
> Since the thread dump comes from the JVM can't you just start it up like:
>
> java YourProgram 2>&1 > /tmp/thread_dump
>
> That way anything that comes out of the process on stdout or stderr will
> fall into that file.
>   -M@
>
> --
> Matt Hixson
> Aventail Corporation
> Seattle, Washington
> www.aventail.com
>
> On Thu, 30 Aug 2001, Gene Chuang wrote:
>
> > Depends on your operating system.  For Solaris/Unix, it's 'ps'.
> >
> > While we're on the topic of Java processes, I've got a question:
> >
> > We're running Solaris 2.7 + JDK 1.3.1, and I find one of the best
> debugging
> > "tools" for our J2EE application is 'kill -3 xxx', where xxx is the
> process
> > id.  This of course produces a full thread dump and is extremely useful in
> > diagnosing a hung or deadlocked server.  However, I was wondering if
> anyone
> > know how to redirect this output to, say, a log file, instead of standard
> > out?  I've tried playing around with a all other kill signals (1-9), a
> > couple of them do produce a log file;  but not with the thread dump.
> >
> > Gene
> >
> > -----Original Message-----
> > From: Sankaran, Rajesh [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, August 30, 2001 9:46 AM
> > To: [EMAIL PROTECTED]
> > Subject: How to find process id of a java process?
> >
> >
> > Hi all,
> >
> > This may not be an appropriate question in this list, but could someone
> > through light or directions on how to find out process id of a java
> process?
> >
> > Thanks.
> > Rajesh
> >
> >
> ===========================================================================
> > To unsubscribe, send email to [EMAIL PROTECTED] and include in the
> body
> > of the message "signoff EJB-INTEREST".  For general help, send email to
> > [EMAIL PROTECTED] and include in the body of the message "help".
> >
> >
> ===========================================================================
> > To unsubscribe, send email to [EMAIL PROTECTED] and include in the
> body
> > of the message "signoff EJB-INTEREST".  For general help, send email to
> > [EMAIL PROTECTED] and include in the body of the message "help".
> >
>
> ===========================================================================
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff EJB-INTEREST".  For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".
>

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to