Hi Scott,

Yeah, I was hoping for a clean solution, but seems like I'm out of luck.
Currently the only thing I can do to come close to a separate thread dump
log is a script that:

1) finds java process
2) 'tail' main log file to a new log file
3) 'kill -3'

This will produce an "auxiliary" logfile with the kill signal near the top,
but will not preclude other stray stdouts that may slip in.

Gene

-----Original Message-----
From: Scott Stirling [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 30, 2001 10:46 AM
To: 'Gene Chuang'; [EMAIL PROTECTED]
Subject: RE: [EJB-INT] How to find process id of a java process?


We've tried all sorts of tricks to do this in the past.  No dice.  The
SIGQUIT causes the VM to dump direct to stderr.  Your best bet is to
redirect stderr when starting the program and collect the traces in there.
If you're app logs stuff to stderr and you don't like mixing the output,
modify the app or live with it; you can make your app log to an output other
than stderr, but you can't make the JVM dump trace to anything but stderr.

You can do the SIGQUITs on Windows too with Ctrl+Pause/Break, but make sure
you start the JVM with the -Xrs flag if using the 1.3.1 JVM, else the JVM
will just die when you do it.

Scott Stirling
JRun QA
Macromedia

> -----Original Message-----
> From: Gene Chuang [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, August 30, 2001 1:29 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [EJB-INT] How to find process id of a java process?
>
>
> 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@

===========================================================================
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