You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Christopher Schultz <ch...@christopherschultz.net> on 2011/12/01 00:14:42 UTC

Re: Logging

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Thom,

On 11/30/11 1:04 PM, Thom Hehl wrote:
> I'm using VI to reading the log file. I running a Windows RDP.

Are you using 'vi' in a way that allows it to get updates from the
file? I'm no 'vi' expert, but I'm sure it reads the entire file at
startup and thinks that it doesn't change.

Try using:

> tail -f stdout.log

If you have a POSIX environment handy (like Cygwin, or gnuutils or
whatever).

- -chris

PS: vi on Windows? That's doing things the hard way. ;)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk7WuOIACgkQ9CaO5/Lv0PA8hQCfbPXtlASPD28Nr1R7xayvAhZM
OWgAoJtmfQ9IHfVNVip7nqSX0vjqonLg
=lvdm
-----END PGP SIGNATURE-----

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


Re: Logging

Posted by Pid <pi...@pidster.com>.
On 01/12/2011 14:39, Thom Hehl wrote:
> I'm not sure. Whichever log file the stack traces goto. Yes, they're writing to a local drive. Yes as a windows service which came with the installer.

Well, given that this is configurable, it could be anywhere...

You could find out & let us know.  A precise answer may help us explain
why you're seeing a behavior that is unusual.


p


> -----Original Message-----
> From: Daniel Mikusa [mailto:dmikusa@vmware.com] 
> Sent: Thursday, December 01, 2011 9:38 AM
> To: Tomcat Users List
> Subject: RE: Logging
> 
> On Thu, 2011-12-01 at 06:01 -0800, Thom Hehl wrote:
>> I'm looking for stack traces. People report defects and we get a stack trace and I need to see it in the log, but instead, the log is still in the buffer. Usually I have to shutdown the server and start it back up to get the log entries. I'd just like to be able to flush the logs without shutting down the server.
> 
> Is this happening for all of your log files?  or just a specific one?
> If specific, what is the name of the log file where this is occurring?
> 
> Also, can you confirm that Tomcat is writing the log file to a local
> disk and not a remote share like Samba or NFS?
> 
> Lastly, you said you're running Tomcat 7.0.20 as a daemon.  I'm assuming
> this means you're running it as a Windows Service.  Please correct me if
> I'm wrong.  Are you using the service wrapper that ships with Tomcat or
> are you using a different one?  Like Java Service Wrapper
> (http://www.tanukisoftware.com/en/wrapper.php).
> 
> Dan
> 
> 
>> -----Original Message-----
>> From: Pid [mailto:pid@pidster.com] 
>> Sent: Thursday, December 01, 2011 8:38 AM
>> To: Tomcat Users List
>> Subject: Re: Logging
>>
>> On 01/12/2011 13:03, Thom Hehl wrote:
>>>
>>>
>>> -----Original Message-----
>>> From: Christopher Schultz [mailto:chris@christopherschultz.net]
>>> Sent: Wednesday, November 30, 2011 6:15 PM
>>> To: Tomcat Users List
>>> Subject: Re: Logging
>>>
>>> Thom,
>>>
>>> On 11/30/11 1:04 PM, Thom Hehl wrote:
>>>>> I'm using VI to reading the log file. I running a Windows RDP.
>>>
>>>> Are you using 'vi' in a way that allows it to get updates from the 
>>>> file? I'm no 'vi' expert, but I'm sure it reads the entire file at 
>>>> startup and thinks that it doesn't change.
>>>
>>> Actually, it monitors the file and allows you to load changes if the file changes. The problem is that this is a test server and so it may take days to dump the log I need. So the tool reading it is not the problem, it's the fact that tomcat hasn't flushed to the file yet.
>>
>> Can you explain a little more about where what is generating log data and into which log it is being written?
>>
>> How long is the delay between when you expect the event to happen and the emission of a log record?
>>
>>
>> p
>>
>>
>>>> Try using:
>>>
>>>> tail -f stdout.log
>>>
>>>> If you have a POSIX environment handy (like Cygwin, or gnuutils or 
>>>> whatever).
>>>
>>>> - -chris
>>>
>>>> PS: vi on Windows? That's doing things the hard way. ;)
>>>
>>> Oh, contraire...although one of the hardest editors to learn to use (IBM's XEDIT comes to mind as equally hard) vi is the best editor to use EVER.
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>
>>


-- 

[key:62590808]


Re: Logging

Posted by "Terence M. Bandoian" <te...@tmbsw.com>.
  On 1:59 PM, Christopher Schultz wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Thom,
>
> On 12/1/11 9:39 AM, Thom Hehl wrote:
>> I'm not sure. Whichever log file the stack traces goto. Yes,
>> they're writing to a local drive. Yes as a windows service which
>> came with the installer.
> As Pid says, it's all configurable.
>
> The log files that Tomcat itself opens are controlled by
> logging.properties and, AFAIK, not buffered.
>
> Running Tomcat as a Windows Service usually uses a service wrapped
> that dumps stdout to stdout.txt or stdout.log or whatever. I believe
> that is also not buffered.
>
> If your webapp is doing any of it's own logging, then you are
> completely at the mercy of whatever component is configuring that
> logging system, and it has nothing to do with Tomcat.
>
> If you could tell us the name of the file, it might help because there
> are certain filenames that are likely to be Tomcat-generated and
> others are likely to be webapp-generated. Saying "I dunno, the one
> where the logs go" is not helpful.
>
> Thanks,
> - -chris

Hi, Thom-

See http://tomcat.apache.org/tomcat-6.0-doc/logging.html for Tomcat 6.  
Search for bufferSize which appears to work as documented on my system.

Also, with Tomcat 6 executing as a Windows service, calls to 
System.out.println on my system are written to stdout_YYYYMMDD.log in 
the Tomcat logs directory.  There does not appear to be any buffering 
nor any way to control buffering of output to System.out.

What you're experiencing may be related to file locking on Windows.  Try 
opening a log file in Notepad without stopping Tomcat after you're sure 
something has been output to that file.  The most recent output should 
be included.

-Terence Bandoian

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


Re: Logging

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Thom,

On 12/1/11 9:39 AM, Thom Hehl wrote:
> I'm not sure. Whichever log file the stack traces goto. Yes,
> they're writing to a local drive. Yes as a windows service which
> came with the installer.

As Pid says, it's all configurable.

The log files that Tomcat itself opens are controlled by
logging.properties and, AFAIK, not buffered.

Running Tomcat as a Windows Service usually uses a service wrapped
that dumps stdout to stdout.txt or stdout.log or whatever. I believe
that is also not buffered.

If your webapp is doing any of it's own logging, then you are
completely at the mercy of whatever component is configuring that
logging system, and it has nothing to do with Tomcat.

If you could tell us the name of the file, it might help because there
are certain filenames that are likely to be Tomcat-generated and
others are likely to be webapp-generated. Saying "I dunno, the one
where the logs go" is not helpful.

Thanks,
- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk7YBIkACgkQ9CaO5/Lv0PCbEgCfZ1eoQ/KrAFJyxbExSbmRT/AN
bNkAn3OkigB8GL3OEULQPvz7khX2Fqat
=1L6y
-----END PGP SIGNATURE-----

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


RE: Logging

Posted by Thom Hehl <Th...@pointsix.com>.
I'm not sure. Whichever log file the stack traces goto. Yes, they're writing to a local drive. Yes as a windows service which came with the installer.

-----Original Message-----
From: Daniel Mikusa [mailto:dmikusa@vmware.com] 
Sent: Thursday, December 01, 2011 9:38 AM
To: Tomcat Users List
Subject: RE: Logging

On Thu, 2011-12-01 at 06:01 -0800, Thom Hehl wrote:
> I'm looking for stack traces. People report defects and we get a stack trace and I need to see it in the log, but instead, the log is still in the buffer. Usually I have to shutdown the server and start it back up to get the log entries. I'd just like to be able to flush the logs without shutting down the server.

Is this happening for all of your log files?  or just a specific one?
If specific, what is the name of the log file where this is occurring?

Also, can you confirm that Tomcat is writing the log file to a local
disk and not a remote share like Samba or NFS?

Lastly, you said you're running Tomcat 7.0.20 as a daemon.  I'm assuming
this means you're running it as a Windows Service.  Please correct me if
I'm wrong.  Are you using the service wrapper that ships with Tomcat or
are you using a different one?  Like Java Service Wrapper
(http://www.tanukisoftware.com/en/wrapper.php).

Dan


> -----Original Message-----
> From: Pid [mailto:pid@pidster.com] 
> Sent: Thursday, December 01, 2011 8:38 AM
> To: Tomcat Users List
> Subject: Re: Logging
> 
> On 01/12/2011 13:03, Thom Hehl wrote:
> > 
> > 
> > -----Original Message-----
> > From: Christopher Schultz [mailto:chris@christopherschultz.net]
> > Sent: Wednesday, November 30, 2011 6:15 PM
> > To: Tomcat Users List
> > Subject: Re: Logging
> > 
> > Thom,
> > 
> > On 11/30/11 1:04 PM, Thom Hehl wrote:
> >>> I'm using VI to reading the log file. I running a Windows RDP.
> > 
> >> Are you using 'vi' in a way that allows it to get updates from the 
> >> file? I'm no 'vi' expert, but I'm sure it reads the entire file at 
> >> startup and thinks that it doesn't change.
> > 
> > Actually, it monitors the file and allows you to load changes if the file changes. The problem is that this is a test server and so it may take days to dump the log I need. So the tool reading it is not the problem, it's the fact that tomcat hasn't flushed to the file yet.
> 
> Can you explain a little more about where what is generating log data and into which log it is being written?
> 
> How long is the delay between when you expect the event to happen and the emission of a log record?
> 
> 
> p
> 
> 
> >> Try using:
> > 
> >> tail -f stdout.log
> > 
> >> If you have a POSIX environment handy (like Cygwin, or gnuutils or 
> >> whatever).
> > 
> >> - -chris
> > 
> >> PS: vi on Windows? That's doing things the hard way. ;)
> > 
> > Oh, contraire...although one of the hardest editors to learn to use (IBM's XEDIT comes to mind as equally hard) vi is the best editor to use EVER.
> > 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> > For additional commands, e-mail: users-help@tomcat.apache.org
> > 
> 

RE: Logging

Posted by Daniel Mikusa <dm...@vmware.com>.
On Thu, 2011-12-01 at 06:01 -0800, Thom Hehl wrote:
> I'm looking for stack traces. People report defects and we get a stack trace and I need to see it in the log, but instead, the log is still in the buffer. Usually I have to shutdown the server and start it back up to get the log entries. I'd just like to be able to flush the logs without shutting down the server.

Is this happening for all of your log files?  or just a specific one?
If specific, what is the name of the log file where this is occurring?

Also, can you confirm that Tomcat is writing the log file to a local
disk and not a remote share like Samba or NFS?

Lastly, you said you're running Tomcat 7.0.20 as a daemon.  I'm assuming
this means you're running it as a Windows Service.  Please correct me if
I'm wrong.  Are you using the service wrapper that ships with Tomcat or
are you using a different one?  Like Java Service Wrapper
(http://www.tanukisoftware.com/en/wrapper.php).

Dan


> -----Original Message-----
> From: Pid [mailto:pid@pidster.com] 
> Sent: Thursday, December 01, 2011 8:38 AM
> To: Tomcat Users List
> Subject: Re: Logging
> 
> On 01/12/2011 13:03, Thom Hehl wrote:
> > 
> > 
> > -----Original Message-----
> > From: Christopher Schultz [mailto:chris@christopherschultz.net]
> > Sent: Wednesday, November 30, 2011 6:15 PM
> > To: Tomcat Users List
> > Subject: Re: Logging
> > 
> > Thom,
> > 
> > On 11/30/11 1:04 PM, Thom Hehl wrote:
> >>> I'm using VI to reading the log file. I running a Windows RDP.
> > 
> >> Are you using 'vi' in a way that allows it to get updates from the 
> >> file? I'm no 'vi' expert, but I'm sure it reads the entire file at 
> >> startup and thinks that it doesn't change.
> > 
> > Actually, it monitors the file and allows you to load changes if the file changes. The problem is that this is a test server and so it may take days to dump the log I need. So the tool reading it is not the problem, it's the fact that tomcat hasn't flushed to the file yet.
> 
> Can you explain a little more about where what is generating log data and into which log it is being written?
> 
> How long is the delay between when you expect the event to happen and the emission of a log record?
> 
> 
> p
> 
> 
> >> Try using:
> > 
> >> tail -f stdout.log
> > 
> >> If you have a POSIX environment handy (like Cygwin, or gnuutils or 
> >> whatever).
> > 
> >> - -chris
> > 
> >> PS: vi on Windows? That's doing things the hard way. ;)
> > 
> > Oh, contraire...although one of the hardest editors to learn to use (IBM's XEDIT comes to mind as equally hard) vi is the best editor to use EVER.
> > 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> > For additional commands, e-mail: users-help@tomcat.apache.org
> > 
> 

Re: Logging

Posted by Pid <pi...@pidster.com>.
On 01/12/2011 14:10, Pid wrote:
> On 01/12/2011 14:01, Thom Hehl wrote:
>> I'm looking for stack traces. People report defects and we get a stack trace and I need to see it in the log, but instead, the log is still in the buffer. Usually I have to shutdown the server and start it back up to get the log entries. I'd just like to be able to flush the logs without shutting down the server.

(I sent this direct, somehow by accident)

> (Please don't top post.)
> 
> Yes, it's this 'buffering' problem that I'm interested in as I do not
> see this in my own copies of Tomcat, nor in the ones I observe in my
> professional capacity.
> 
> This is why I asked for:
> 
>  a) which log file
>  b) what is generating the log message
> 
> If you can also provide an example of a stack trace that was only
> flushed during shutdown, that would also be good.
> 
> 
> p
> 
>> -----Original Message-----
>> From: Pid [mailto:pid@pidster.com] 
>> Sent: Thursday, December 01, 2011 8:38 AM
>> To: Tomcat Users List
>> Subject: Re: Logging
>>
>> On 01/12/2011 13:03, Thom Hehl wrote:
>>>
>>>
>>> -----Original Message-----
>>> From: Christopher Schultz [mailto:chris@christopherschultz.net]
>>> Sent: Wednesday, November 30, 2011 6:15 PM
>>> To: Tomcat Users List
>>> Subject: Re: Logging
>>>
>>> Thom,
>>>
>>> On 11/30/11 1:04 PM, Thom Hehl wrote:
>>>>> I'm using VI to reading the log file. I running a Windows RDP.
>>>
>>>> Are you using 'vi' in a way that allows it to get updates from the 
>>>> file? I'm no 'vi' expert, but I'm sure it reads the entire file at 
>>>> startup and thinks that it doesn't change.
>>>
>>> Actually, it monitors the file and allows you to load changes if the file changes. The problem is that this is a test server and so it may take days to dump the log I need. So the tool reading it is not the problem, it's the fact that tomcat hasn't flushed to the file yet.
>>
>> Can you explain a little more about where what is generating log data and into which log it is being written?
>>
>> How long is the delay between when you expect the event to happen and the emission of a log record?
>>
>>
>> p
>>
>>
>>>> Try using:
>>>
>>>> tail -f stdout.log
>>>
>>>> If you have a POSIX environment handy (like Cygwin, or gnuutils or 
>>>> whatever).
>>>
>>>> - -chris
>>>
>>>> PS: vi on Windows? That's doing things the hard way. ;)
>>>
>>> Oh, contraire...although one of the hardest editors to learn to use (IBM's XEDIT comes to mind as equally hard) vi is the best editor to use EVER.
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>
>>
> 
> 


-- 

[key:62590808]


RE: Logging

Posted by Thom Hehl <Th...@pointsix.com>.
I'm looking for stack traces. People report defects and we get a stack trace and I need to see it in the log, but instead, the log is still in the buffer. Usually I have to shutdown the server and start it back up to get the log entries. I'd just like to be able to flush the logs without shutting down the server.

-----Original Message-----
From: Pid [mailto:pid@pidster.com] 
Sent: Thursday, December 01, 2011 8:38 AM
To: Tomcat Users List
Subject: Re: Logging

On 01/12/2011 13:03, Thom Hehl wrote:
> 
> 
> -----Original Message-----
> From: Christopher Schultz [mailto:chris@christopherschultz.net]
> Sent: Wednesday, November 30, 2011 6:15 PM
> To: Tomcat Users List
> Subject: Re: Logging
> 
> Thom,
> 
> On 11/30/11 1:04 PM, Thom Hehl wrote:
>>> I'm using VI to reading the log file. I running a Windows RDP.
> 
>> Are you using 'vi' in a way that allows it to get updates from the 
>> file? I'm no 'vi' expert, but I'm sure it reads the entire file at 
>> startup and thinks that it doesn't change.
> 
> Actually, it monitors the file and allows you to load changes if the file changes. The problem is that this is a test server and so it may take days to dump the log I need. So the tool reading it is not the problem, it's the fact that tomcat hasn't flushed to the file yet.

Can you explain a little more about where what is generating log data and into which log it is being written?

How long is the delay between when you expect the event to happen and the emission of a log record?


p


>> Try using:
> 
>> tail -f stdout.log
> 
>> If you have a POSIX environment handy (like Cygwin, or gnuutils or 
>> whatever).
> 
>> - -chris
> 
>> PS: vi on Windows? That's doing things the hard way. ;)
> 
> Oh, contraire...although one of the hardest editors to learn to use (IBM's XEDIT comes to mind as equally hard) vi is the best editor to use EVER.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 

-- 

[key:62590808]


Re: Logging

Posted by Pid <pi...@pidster.com>.
On 01/12/2011 13:03, Thom Hehl wrote:
> 
> 
> -----Original Message-----
> From: Christopher Schultz [mailto:chris@christopherschultz.net] 
> Sent: Wednesday, November 30, 2011 6:15 PM
> To: Tomcat Users List
> Subject: Re: Logging
> 
> Thom,
> 
> On 11/30/11 1:04 PM, Thom Hehl wrote:
>>> I'm using VI to reading the log file. I running a Windows RDP.
> 
>> Are you using 'vi' in a way that allows it to get updates from the
>> file? I'm no 'vi' expert, but I'm sure it reads the entire file at
>> startup and thinks that it doesn't change.
> 
> Actually, it monitors the file and allows you to load changes if the file changes. The problem is that this is a test server and so it may take days to dump the log I need. So the tool reading it is not the problem, it's the fact that tomcat hasn't flushed to the file yet.

Can you explain a little more about where what is generating log data
and into which log it is being written?

How long is the delay between when you expect the event to happen and
the emission of a log record?


p


>> Try using:
> 
>> tail -f stdout.log
> 
>> If you have a POSIX environment handy (like Cygwin, or gnuutils or
>> whatever).
> 
>> - -chris
> 
>> PS: vi on Windows? That's doing things the hard way. ;)
> 
> Oh, contraire...although one of the hardest editors to learn to use (IBM's XEDIT comes to mind as equally hard) vi is the best editor to use EVER.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 

-- 

[key:62590808]


RE: Logging

Posted by Thom Hehl <Th...@pointsix.com>.

-----Original Message-----
From: Christopher Schultz [mailto:chris@christopherschultz.net] 
Sent: Wednesday, November 30, 2011 6:15 PM
To: Tomcat Users List
Subject: Re: Logging

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Thom,

On 11/30/11 1:04 PM, Thom Hehl wrote:
>> I'm using VI to reading the log file. I running a Windows RDP.

>Are you using 'vi' in a way that allows it to get updates from the
>file? I'm no 'vi' expert, but I'm sure it reads the entire file at
>startup and thinks that it doesn't change.

Actually, it monitors the file and allows you to load changes if the file changes. The problem is that this is a test server and so it may take days to dump the log I need. So the tool reading it is not the problem, it's the fact that tomcat hasn't flushed to the file yet.

>Try using:

> tail -f stdout.log

>If you have a POSIX environment handy (like Cygwin, or gnuutils or
>whatever).

>- -chris

>PS: vi on Windows? That's doing things the hard way. ;)

Oh, contraire...although one of the hardest editors to learn to use (IBM's XEDIT comes to mind as equally hard) vi is the best editor to use EVER.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk7WuOIACgkQ9CaO5/Lv0PA8hQCfbPXtlASPD28Nr1R7xayvAhZM
OWgAoJtmfQ9IHfVNVip7nqSX0vjqonLg
=lvdm
-----END PGP SIGNATURE-----

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


Re: Logging

Posted by Pid <pi...@pidster.com>.
On 30/11/2011 23:14, Christopher Schultz wrote:
> Thom,
> 
> On 11/30/11 1:04 PM, Thom Hehl wrote:
>> I'm using VI to reading the log file. I running a Windows RDP.
> 
> Are you using 'vi' in a way that allows it to get updates from the
> file? I'm no 'vi' expert, but I'm sure it reads the entire file at
> startup and thinks that it doesn't change.

Yup.


p

> Try using:
> 
>> tail -f stdout.log
> 
> If you have a POSIX environment handy (like Cygwin, or gnuutils or
> whatever).
> 
> -chris
> 
> PS: vi on Windows? That's doing things the hard way. ;)
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 

-- 

[key:62590808]