[Tutor] Writing to a remote file
lkvam at venix.com
Fri Jun 16 18:24:45 CEST 2006
On Fri, 2006-06-16 at 14:47 +0100, kieran flanagan wrote:
> 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 ?.
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.
> "Behind every great man, there is a great woman. Behind that woman is
> Tutor maillist - Tutor at python.org
1 Court Street, Suite 378
Lebanon, NH 03766-1358
More information about the Tutor