[Zope3-checkins] CVS: Zope3/doc - LOGGING.txt:1.10
Guido van Rossum
guido@python.org
Thu, 19 Dec 2002 18:15:35 -0500
Update of /cvs-repository/Zope3/doc
In directory cvs.zope.org:/tmp/cvs-serv18006
Modified Files:
LOGGING.txt
Log Message:
Get rid of old docs about zLOG. Needs updates. :-)
=== Zope3/doc/LOGGING.txt 1.9 => 1.10 ===
--- Zope3/doc/LOGGING.txt:1.9 Fri Aug 9 12:53:10 2002
+++ Zope3/doc/LOGGING.txt Thu Dec 19 18:15:35 2002
@@ -1,104 +1,5 @@
Zope Logging
- Logging is done through the zLOG package (which may be replaced by a
- PEP 282-based logging module in Python 2.3 once it's ready).
+ Logging is done through the logging package (PEP 282-based logging).
- Currently, the following environment variables can be set:
-
- STUPID_LOG_FILE="path"
-
- The stupid file logger writes Zope logging information to a file.
- It is not very smart about it - it just dumps it to a file and the
- format is not very configurable - hence the name.
-
- ZSYSLOG="/dev/log"
-
- Setting this environment variable will cause Zope to try and write
- to the named UNIX domain socket (usually '/dev/log'). This will only
- work on UNIX.
-
- (In versions up to Zope 2.6, this also caused the access log
- to be sent to syslog. In version 2.6 this is now controlled
- by the separate ZSYSLOG_ACCESS environment variable)
-
- ZSYSLOG_FACILITY="facilityname"
-
- Setting this environment variable will cause Zope to use the
- syslog logger with the given facility. This environment variable
- is optional and overrides the default facility "user". This will
- only work on UNIX.
-
- ZSYSLOG_SERVER="machine.name:port"
-
- Setting this environment variable tells Zope to connect a UDP
- socket to machine.name (which can be a name or IP address) and
- 'port' which must be an integer. The default syslogd port is '514'
- but Zope does not pick a sane default, you must specify a port.
- This may change, so check back here in future Zope releases.
-
- (In versions up to Zope 2.6, this also caused the access log
- to be sent to syslog. In version 2.6 this is now controlled
- by the separate ZSYSLOG_ACCESS_SERVER environment variable)
-
-
-Calling the logger in your code
-
- If you want your own Zope extensions to use logging:
-
- import zLOG
- zLOG.LOG(subsystem, severity, summary, detail, error, reraise)
-
- The following arguments are required:
-
- subsystem -- The subsystem generating the message (e.g. ZODB)
-
- severity -- The "severity" of the event. This may be an integer or
- a floating point number. Logging back ends may
- consider the int() of this value to be significant.
- For example, a backend may consider any severity
- with integer value of WARNING to be a warning. By
- default, the zLOG module defines the following
- severities:
-
- BLATHER=-100
- INFO=0
- PROBLEM=WARNING=100
- ERROR=200
- PANIC=300
-
- summary -- A short summary of the event.
-
- detail -- A detailed description.
-
- error -- A three-element tuple consisting of an error type, value, and
- traceback. If provided, then a summary of the error
- is added to the detail.
-
- reraise -- If provided with a true value, then the error given by
- error is reraised.
-
-
-Creating your own Logger
-
- Creating your own Zope logger is easy. Simply define a logger class
- with the following interface::
-
- class LumberJack:
- """ an ok Logger
-
- I sleep all night, I work all day
- """
-
- def __init__(self):
- pass
-
- def __call__(self, sub, sev, sum, det, err):
- print ' %s, %s, %s, %s, %s, %s' % (self, sub, sev, sum, det, err)
-
-
-Then you must edit lib/python/Zope/ZLogger/ZLogger.py and instantiate
-one of your Loggers in the 'logger' tuple::
-
- loggers = (stupidFileLogger.stupidFileLogger(),
- syslogLogger.syslogLogger(),
- LumberJack.LumberJack(),)
+ XXX This description needs to be updated.