You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Johnny Kewl <jo...@kewlstuff.co.za> on 2007/05/02 20:34:00 UTC

Log files always locked

Just something that bugs me.....
On windows if you try open a tomcat log file... which are typically associated with something like notepad, you get "In Use By Another Program".
Why does Tomcat lock the file handle indefinitely?
It maybe good programming practice but windows utilities generally dont give one the option of "will open as read only"... its always a mission just to read a log file.

Re: Log files always locked

Posted by Brantley Hobbs <sb...@uga.edu>.
Ultraedit also works.

If I could threadjack here, I'd like to point out my own gripe with 
windows tomcat logging.  Can we please make it out of the box log all 
stdout stuff to a *single* catalina.out file that doesn't roll over? 
That's a pain.  I like to set up an icon to my log file, but I can't 
because it's always moving.......

My $0.02.

B.

Venkat Venkataramanan wrote:
> Johnny:
> 
> I use Textpad to open the log file; if the log file is updated, it will
> automatically update the screen. Try that.
> 
> -----Original Message-----
> From: Johnny Kewl [mailto:john@kewlstuff.co.za] 
> Sent: Wednesday, May 02, 2007 2:34 PM
> To: Tomcat Users List
> Subject: Log files always locked
> 
> Just something that bugs me.....
> On windows if you try open a tomcat log file... which are typically
> associated with something like notepad, you get "In Use By Another Program".
> Why does Tomcat lock the file handle indefinitely?
> It maybe good programming practice but windows utilities generally dont give
> one the option of "will open as read only"... its always a mission just to
> read a log file.
> 
> 
> ---------------------------------------------------------------------
> 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
> 

---------------------------------------------------------------------
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: Log files always locked

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Johnny Kewl [mailto:john@kewlstuff.co.za] 
> Subject: Re: Log files always locked
> 
> I think its just because a copy on a drag and drop is opening 
> the file as read only...
> Thing is utilities like notepad and wordpad will try open rw.

Makes sense.  What about a real editor like ConTEXT or jEdit (or myriad
others)?

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
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: Log files always locked

Posted by Johnny Kewl <jo...@kewlstuff.co.za>.
I think its just because a copy on a drag and drop is opening the file as 
read only...
Thing is utilities like notepad and wordpad will try open rw.

----- Original Message ----- 
From: "Caldarale, Charles R" <Ch...@unisys.com>
To: "Tomcat Users List" <us...@tomcat.apache.org>
Sent: Wednesday, May 02, 2007 10:54 PM
Subject: RE: Log files always locked


> From: Johnny Kewl [mailto:john@kewlstuff.co.za]
> Subject: Re: Log files always locked
>
> but if you look at Propes, Barry L  post... thats exactly wot
> I had to do.... ie copy all the files... and then open them...

That doesn't really make sense: if they were hard locked, how were you
able to copy them?  The lock should have prevented the copy as well.



---------------------------------------------------------------------
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: Log files always locked

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Johnny Kewl [mailto:john@kewlstuff.co.za] 
> Subject: Re: Log files always locked
> 
> but if you look at Propes, Barry L  post... thats exactly wot 
> I had to do.... ie copy all the files... and then open them...

That doesn't really make sense: if they were hard locked, how were you
able to copy them?  The lock should have prevented the copy as well.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
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: Log files always locked

Posted by Johnny Kewl <jo...@kewlstuff.co.za>.
Wots Up Doc!... Rashmi I am using the Windows Installer... and when I saw 
what you said
I killed every thing and then just started and stopped Tomcat... and guess 
wot!... the
files are not locking... ie they letting other programs open them.

So now I dont know whats causing the solid lock... but when it does happen 
its
not a fleeting thing..... its a solid block for any program trying to open 
with "read write" access.

.... was beginning to think maybe it was just me
but if you look at Propes, Barry L  post... thats exactly wot I had to 
do.... ie copy
all the files... and then open them... which sucks.

Clearly Tomcat is not designed to hard lock them.... but something causes 
it.
Anyway.... I'll keep an eye on it and see if I can figure out what it is I 
do... that makes
them hard lock.

I'm always developing so it may be something subtle like a netbeans program 
bug that makes Tomcat not close the handle.... beats me but it happens a 
lot.
I think the work arounds the other guys have found like those text editors, 
are opening as read only... and thats why they work... but there is 
something weird going on.

Thanks Johnny

----- Original Message ----- 
From: "Rashmi Rubdi" <ra...@gmail.com>
To: "Tomcat Users List" <us...@tomcat.apache.org>
Sent: Wednesday, May 02, 2007 9:07 PM
Subject: Re: Log files always locked


> I'm able to open Tomcat log files with Notepad, while Tomcat is running.
>
> I guess the lock happens when Tomcat is writing to the log file, and
> the file is being opened simultaneously. I think you're using the
> Windows Installer and I've installed mine from the zip file. I don't
> know if it makes a difference in case of locking log files.
>
> Also there are few tail -f utilities for Windows that simulate the
> Unix tail -f command, helpful to view recent changes to the log file
> or see it running. I don't know if Textpad does that, you my have to
> scroll to the bottom to see changes.
>
> Regards
> Rashmi
>


---------------------------------------------------------------------
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: Log files always locked

Posted by Rashmi Rubdi <ra...@gmail.com>.
I'm able to open Tomcat log files with Notepad, while Tomcat is running.

I guess the lock happens when Tomcat is writing to the log file, and
the file is being opened simultaneously. I think you're using the
Windows Installer and I've installed mine from the zip file. I don't
know if it makes a difference in case of locking log files.

Also there are few tail -f utilities for Windows that simulate the
Unix tail -f command, helpful to view recent changes to the log file
or see it running. I don't know if Textpad does that, you my have to
scroll to the bottom to see changes.

Regards
Rashmi

On 5/2/07, Johnny Kewl <jo...@kewlstuff.co.za> wrote:
> Thanks... does the trick.
> But still wondering why the file handles are left open... I would think its
> not good practice.
>
>
> ----- Original Message -----
> From: "Venkat Venkataramanan" <th...@gmail.com>
> To: "'Tomcat Users List'" <us...@tomcat.apache.org>
> Sent: Wednesday, May 02, 2007 8:45 PM
> Subject: RE: Log files always locked
>
>
> > Johnny:
> >
> > I use Textpad to open the log file; if the log file is updated, it will
> > automatically update the screen. Try that.
> >
> > -----Original Message-----
> > From: Johnny Kewl [mailto:john@kewlstuff.co.za]
> > Sent: Wednesday, May 02, 2007 2:34 PM
> > To: Tomcat Users List
> > Subject: Log files always locked
> >
> > Just something that bugs me.....
> > On windows if you try open a tomcat log file... which are typically
> > associated with something like notepad, you get "In Use By Another
> > Program".
> > Why does Tomcat lock the file handle indefinitely?
> > It maybe good programming practice but windows utilities generally dont
> > give
> > one the option of "will open as read only"... its always a mission just to
> > read a log file.

---------------------------------------------------------------------
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: Log files always locked

Posted by David Kerber <dc...@verizon.net>.
Johnny Kewl wrote:

> Thanks... does the trick.
> But still wondering why the file handles are left open... I would 
> think its
> not good practice.

I would assume for performance reasons, but that's just a guess.  I do 
the same thing when I know I'm going to be doing a lot of writing, but 
if there are only going to be occasional writes, then I close it every time.

>
>
> ----- Original Message ----- From: "Venkat Venkataramanan" 
> <th...@gmail.com>
> To: "'Tomcat Users List'" <us...@tomcat.apache.org>
> Sent: Wednesday, May 02, 2007 8:45 PM
> Subject: RE: Log files always locked
>
>
>> Johnny:
>>
>> I use Textpad to open the log file; if the log file is updated, it will
>> automatically update the screen. Try that.
>>
>> -----Original Message-----
>> From: Johnny Kewl [mailto:john@kewlstuff.co.za]
>> Sent: Wednesday, May 02, 2007 2:34 PM
>> To: Tomcat Users List
>> Subject: Log files always locked
>>
>> Just something that bugs me.....
>> On windows if you try open a tomcat log file... which are typically
>> associated with something like notepad, you get "In Use By Another
>> Program".
>> Why does Tomcat lock the file handle indefinitely?
>> It maybe good programming practice but windows utilities generally dont
>> give
>> one the option of "will open as read only"... its always a mission 
>> just to
>> read a log file.
>



---------------------------------------------------------------------
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: Log files always locked

Posted by Johnny Kewl <jo...@kewlstuff.co.za>.
Thanks... does the trick.
But still wondering why the file handles are left open... I would think its
not good practice.


----- Original Message ----- 
From: "Venkat Venkataramanan" <th...@gmail.com>
To: "'Tomcat Users List'" <us...@tomcat.apache.org>
Sent: Wednesday, May 02, 2007 8:45 PM
Subject: RE: Log files always locked


> Johnny:
>
> I use Textpad to open the log file; if the log file is updated, it will
> automatically update the screen. Try that.
>
> -----Original Message-----
> From: Johnny Kewl [mailto:john@kewlstuff.co.za]
> Sent: Wednesday, May 02, 2007 2:34 PM
> To: Tomcat Users List
> Subject: Log files always locked
>
> Just something that bugs me.....
> On windows if you try open a tomcat log file... which are typically
> associated with something like notepad, you get "In Use By Another
> Program".
> Why does Tomcat lock the file handle indefinitely?
> It maybe good programming practice but windows utilities generally dont
> give
> one the option of "will open as read only"... its always a mission just to
> read a log file.
>
>
> ---------------------------------------------------------------------
> 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
>
>


---------------------------------------------------------------------
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: Log files always locked

Posted by Venkat Venkataramanan <th...@gmail.com>.
Johnny:

I use Textpad to open the log file; if the log file is updated, it will
automatically update the screen. Try that.

-----Original Message-----
From: Johnny Kewl [mailto:john@kewlstuff.co.za] 
Sent: Wednesday, May 02, 2007 2:34 PM
To: Tomcat Users List
Subject: Log files always locked

Just something that bugs me.....
On windows if you try open a tomcat log file... which are typically
associated with something like notepad, you get "In Use By Another Program".
Why does Tomcat lock the file handle indefinitely?
It maybe good programming practice but windows utilities generally dont give
one the option of "will open as read only"... its always a mission just to
read a log file.


---------------------------------------------------------------------
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: Log files always locked

Posted by Steven Rock <st...@ecirkit.org>.
I use tomcat and jboss on windows. I have installed cygwin Unix shell for
windows and put all the commands in my PATH env variable. Then I can run:

tail -f log.out

This continuously shows me the log file as it gets updated. 

-Steve

-----Original Message-----
From: Fargusson.Alan [mailto:Alan.Fargusson@ftb.ca.gov] 
Sent: Wednesday, May 02, 2007 3:54 PM
To: Tomcat Users List
Subject: RE: Log files always locked

I think this is a Windows issue.  I doubt that Tomcat actually locks the log
files.

The reason I think that this is a Windows issue is that I run into the same
thing with other programs.  I don't run Tomcat on Windows, so I can't check
Tomcat log files specifically.

I think that this behavior depends on the type of filesystem used.  In my
case it seems that if a file is on a FAT filesystem I have this problem, but
if it is on a NTFS filesystem I don't.  I have not been able to prove this
though.

-----Original Message-----
From: Johnny Kewl [mailto:john@kewlstuff.co.za]
Sent: Wednesday, May 02, 2007 11:34 AM
To: Tomcat Users List
Subject: Log files always locked


Just something that bugs me.....
On windows if you try open a tomcat log file... which are typically
associated with something like notepad, you get "In Use By Another Program".
Why does Tomcat lock the file handle indefinitely?
It maybe good programming practice but windows utilities generally dont give
one the option of "will open as read only"... its always a mission just to
read a log file.

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


---------------------------------------------------------------------
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: Log files always locked

Posted by "Fargusson.Alan" <Al...@ftb.ca.gov>.
I think this is a Windows issue.  I doubt that Tomcat actually locks the log files.

The reason I think that this is a Windows issue is that I run into the same thing with other programs.  I don't run Tomcat on Windows, so I can't check Tomcat log files specifically.

I think that this behavior depends on the type of filesystem used.  In my case it seems that if a file is on a FAT filesystem I have this problem, but if it is on a NTFS filesystem I don't.  I have not been able to prove this though.

-----Original Message-----
From: Johnny Kewl [mailto:john@kewlstuff.co.za]
Sent: Wednesday, May 02, 2007 11:34 AM
To: Tomcat Users List
Subject: Log files always locked


Just something that bugs me.....
On windows if you try open a tomcat log file... which are typically associated with something like notepad, you get "In Use By Another Program".
Why does Tomcat lock the file handle indefinitely?
It maybe good programming practice but windows utilities generally dont give one the option of "will open as read only"... its always a mission just to read a log file.

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