Re: File locking and logging

From: Vinay Sajip (vinay_sajip_at_yahoo.co.uk)
Date: 12/03/04


Date: 3 Dec 2004 01:47:40 -0800

Kamus of Kadizhar <yan@NsOeSiPnAeMr.com> wrote in message news:<pan.2004.12.03.00.35.11.626712@NsOeSiPnAeMr.com>...
> Thanks to Robert Brewer, I got enough insight into logging to make it work....
>
> Now I have another issue: file locking. Sorry if this is a very basic
> question, but I can't find a handy reference anywhere that mentions this.
>
> When a logger opens a log file for append, is it automatically locked so
> other processes cannot write to it? And what happens if two or more
> processes attempt to log an event at the same time?
>
> Here's my situation. I have two or three workstations that will log an
> event (the playing of a movie). The log file is NFS mounted and all
> workstations will use the same log file. How is file locking implemented?
> Or is it?
>

No file locking is attempted by current logging handlers with respect
to other processes - an ordinary open() call is used. Within a given
Python process, concurrency support is is provided through threading
locks. If you need bullet-proof operation in the scenario where
multiple workstations are logging to the same file, you can do this
through having all workstations log via a SocketHandler to a
designated node, where you run a server process which locally logs to
file events received across the network. There is a working example of
this in the Python 2.4 docs.

Best regards,

Vinay Sajip



Relevant Pages

  • File locking and logging
    ... I got enough insight into logging to make it work.... ... file locking. ... When a logger opens a log file for append, ... workstations will use the same log file. ...
    (comp.lang.python)
  • RE: Logging admin access to workstations
    ... Use a packet sniffer to keep track of her network activities would be my ... if you are using login scripts consider adding a ping to ... the logging processes, and log the processes logging the logging - if ... Logging admin access to workstations ...
    (Security-Basics)
  • Re: Windows XP Pro Issues
    ... the workstations are logging on to the domain instead of the local computer. ... Double check DNS configuration on server and clients, ...
    (microsoft.public.windows.server.networking)
  • Re: Mulitple users logging in at different workstations
    ... > workstations and at the same time. ... > dont want users logging in to multiple computers at the ... > disconnect there connection. ... You can download and try CConnect from this server: ...
    (microsoft.public.win2000.active_directory)
  • Network (domain) connectivity issues
    ... connected to networked printers. ... Logging in: Sometimes logging in can take several minutes. ... Workstations are new PCs, when the log in isn't delayed it will usually ... connection to a WinXP Professional Box. ...
    (microsoft.public.windows.server.sbs)