[Tutor] Writing to a remote file

Lloyd Kvam lkvam at venix.com
Fri Jun 16 18:24:45 CEST 2006


On Fri, 2006-06-16 at 14:47 +0100, kieran flanagan wrote:
> Hi
> 
> I want to run a script on one machine and log output messages to a
> remote file located on another machine. Is there any easy method of
> doing this ?.

http://docs.python.org/lib/module-logging.html

If the remote machine is a file server, you can use the logging module
to write to a file on the remote machine

Also the logging module can be used to easily log to a syslog handler.
If this remote file is a "normal" log file managed by a syslog process
then you should find the python part pretty easy.  The syslog process
still needs to be configured to accept your logging messages, but that
should not be too difficult.

Scanning the logging module docs, it looks like you can use it to write
your own process to run on the remote machine to handle "logging
messages".  Then use the logging module on the local machine to send
"logging messages" to the remote machine.


> Thanks
> Kieran
> 
> -- 
> "Behind every great man, there is a great woman. Behind that woman is
> Mr.T." 
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor
-- 
Lloyd Kvam
Venix Corp.
1 Court Street, Suite 378
Lebanon, NH 03766-1358

voice:  603-653-8139
fax:    320-210-3409



More information about the Tutor mailing list