Hi All,
I'm still uncomfortable with using the system logs for the DC1 status logging
facility. We don't have root privilege on the teragrid sites so will need
to arrange with TG admins to update their syslog configuration files to
include a diversion of LSST-tagged messages to an auxiliary log file.
(Yes, we could dump to the standard log but would TG really appreciate that?)
The python documentation provides demo source code for a variety of logging
styles so setting up a network log server should be relatively
straight-forward. See:
http://docs.python.org/lib/module-logging.html
especially the python source examples in:
# 6.29.2 Basic example
# 6.29.3 Logging to multiple destinations
# 6.29.4 Sending and receiving logging events across a network
Sec 6.29.4 provides a thorough template for the network server and demo
code of its use by clients.
Robyn
On Fri, Jun 09, 2006 at 05:18:30PM -0700, [EMAIL PROTECTED] wrote:
> Hi,
>
> The API for logging DC1 data is a simple Python function, log. Currently,
> the application message will be written to whereever the local syslog.conf
> specifies those messages should be sent (usually /var/log/messages).
>
> >>>import log
> >>>log.log (message, priority)
>
> Priority is defined in any man page for syslog (either in C or Python).
> Priority levels include:
>
> LOG_EMERG system is unusable
> LOG_ALERT action must be taken immediately
> LOG_CRIT critical conditions
> LOG_ERR error conditions
> LOG_WARNING warning conditions
> LOG_NOTICE normal, but significant, condition
> LOG_INFO informational message
> LOG_DEBUG debugging message
>
> The default priority is LOG_INFO, so specifying the priority is optional.
> Also, use these as you would in C, except you will need to specify them
> as Python strings. I haven't found a way around that yet.
>
> >>>log.log("test of python logging", "LOG_ALERT")
>
> You will notice that syslog permits two other parameters, namely option and
> facility. Since this is a system-wide log, I'd like to constrain us
> to using the default facility of LOG_USER with no options. So these will
> not
> be supported parameters for the API.
>
> Also, I discovered a python module for logging that is quite detailed and
> has everyway you could think of logging something. It would be overkill
> for our purposes. It has a handler for sending messages to syslog,
> but the complexity is too high. Not worth it. See Logger class in
> Python logging module for more information.
>
> Comments welcome.
>
> Cheers,
> Michelle
> _______________________________________________
> LSST-data mailing list
> [email protected]
> http://www.lsstmail.org/mailman/listinfo/lsst-data
_______________________________________________
LSST-data mailing list
[email protected]
http://www.lsstmail.org/mailman/listinfo/lsst-data