[Patches] [ python-Patches-1598415 ] Logging Module - followfile patch

SourceForge.net noreply at sourceforge.net
Sun Nov 19 21:32:05 CET 2006


Patches item #1598415, was opened at 2006-11-17 15:44
Message generated for change (Comment added) made by vsajip
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1598415&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Modules
Group: Python 2.5
>Status: Pending
>Resolution: Invalid
Priority: 5
Private: No
Submitted By: chads (cjschr)
Assigned to: Vinay Sajip (vsajip)
Summary: Logging Module - followfile patch

Initial Comment:
Pertaining to the FileHandler and the file being written to:

It's possible that the file being written to will be
rolled-over by an external application such as newsyslog.
By default, FileHandler tracks the file descriptor, 
not the file.  If the original file is renamed, the file 
descriptor is still updated; however, it's probably 
desired that continued updates to the original file take 
place instead.

This patch adds an attribute to the FileHandler class
constructor (and basicConfig kw as well).  If the 
attribute evaluates to True, the filename, not the 
descriptor is tracked.  Basically, the code compares the 
file status from a previous emit call to the current call
before the base class emit is called.  If a difference in
st_ino or st_dev is found, the current stream is 
flush/closed and a new one, based on baseFilename, is
created, file status is updated, and then the base class 
emit is called.


----------------------------------------------------------------------

>Comment By: Vinay Sajip (vsajip)
Date: 2006-11-19 20:32

Message:
Logged In: YES 
user_id=308438
Originator: NO

This patch, relying as it does on Unix-specific details such as i-nodes,
does not appear as if it will work under Windows. For that reason I will
mark it as Pending and Invalid for now, if cjschr can update this tracker
item with how the patch will work on Windows, I will look at it further.
The SF system will automatically close it if no update is made to the item
in approx. 2 weeks, though it can still be reopened after that.

----------------------------------------------------------------------

Comment By: Georg Brandl (gbrandl)
Date: 2006-11-18 19:14

Message:
Logged In: YES 
user_id=849994
Originator: NO

Assigning to Vinay.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1598415&group_id=5470


More information about the Patches mailing list