Commit 8ecc9da6 authored by Ken Manheimer's avatar Ken Manheimer

* Add warning (per Collector #733) that clearing the superuser password

  (in order to enable REMOTE_USER mode) also opens the monitor to any
  user connecting through localhost.
parent e0958726
Zope Logging Zope Logging
Zope2 now comes with a Logging facility called ZLogger. ZLogger is Zope2 now comes with a Logging facility called ZLogger. ZLogger is
an extesable logging system. Currently, ZLogger will log either to a an extensible logging system. Currently, ZLogger will log either to a
file or to syslog (the syslog logging even works on windows because file or to syslog. (Syslog logging works even on windows, because
it talks directly to the syslog server using UDP, instead of the it talks directly to the syslog server using UDP, instead of the
POSIX syslog calls). POSIX syslog calls).
Logging is controlled by setting environment variables. This is done Logging is controlled by setting environment variables. This is done
easiest by providing them on the z2.py command line. For example:: most easily by providing the settings on the z2.py command line. For
example::
$ python1.5.2 z2.py ZSYSLOG_SERVER="syslog.mydomain.com:514" \ $ python1.5.2 z2.py ZSYSLOG_SERVER="syslog.mydomain.com:514" \
STUPID_FILE_LOGGER=var/Zope.log" STUPID_FILE_LOGGER=var/Zope.log"
...@@ -17,8 +18,8 @@ Zope Logging ...@@ -17,8 +18,8 @@ Zope Logging
STUPID_FILE_LOGGER="path" STUPID_FILE_LOGGER="path"
The stupid file logger writes Zope logging information to a file. 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 It is not very smart about it - it just dumps it to a file and the
format is not very configurable), hence the name. format is not very configurable - hence the name.
ZSYSLOG="anything" ZSYSLOG="anything"
...@@ -36,23 +37,20 @@ Zope Logging ...@@ -36,23 +37,20 @@ Zope Logging
Calling the logger in your code Calling the logger in your code
If you want your own Zope extensions to use the logging, it can be If you want your own Zope extensions to use logging:
done so::
import zLOG import zLOG
zLOG.LOG(subsystem, severity, summary, detail, error, reraise) zLOG.LOG(subsystem, severity, summary, detail, error, reraise)
The following arguments are required:
The following required arguments are:
subsystem -- The subsystem generating the message (e.g. ZODB) subsystem -- The subsystem generating the message (e.g. ZODB)
severity -- The "severity" of the event. This may be an integer or severity -- The "severity" of the event. This may be an integer or
a floating point number. Logging back ends may a floating point number. Logging back ends may
consider the int() of this valua to be significant. consider the int() of this value to be significant.
For example, a backend may consider any severity For example, a backend may consider any severity
who's integer value is WARNING to be a warning. By with integer value of WARNING to be a warning. By
default, the zLOG module defines the following default, the zLOG module defines the following
severities: severities:
...@@ -62,9 +60,9 @@ Calling the logger in your code ...@@ -62,9 +60,9 @@ Calling the logger in your code
ERROR=200 ERROR=200
PANIC=300 PANIC=300
summary -- A short summary of the event summary -- A short summary of the event.
detail -- A detailed description detail -- A detailed description.
error -- A three-element tuple consisting of an error type, value, and error -- A three-element tuple consisting of an error type, value, and
traceback. If provided, then a summary of the error traceback. If provided, then a summary of the error
...@@ -72,16 +70,15 @@ Calling the logger in your code ...@@ -72,16 +70,15 @@ Calling the logger in your code
reraise -- If provided with a true value, then the error given by reraise -- If provided with a true value, then the error given by
error is reraised. error is reraised.
Creating your own Logger Creating your own Logger
Creating your own Zope logger is easy. Simply define an logger class Creating your own Zope logger is easy. Simply define a logger class
with the following interface:: with the following interface::
class LumberJack: class LumberJack:
""" a Logger """ an ok Logger
I sleep all night, I work all day I sleep all night, I work all day
""" """
...@@ -93,8 +90,8 @@ Creating your own Logger ...@@ -93,8 +90,8 @@ Creating your own Logger
print ' %s, %s, %s, %s, %s, %s' % (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 instanciate Then you must edit lib/python/Zope/ZLogger/ZLogger.py and instantiate
one of your Loggers into the 'logger' tuple:: one of your Loggers in the 'logger' tuple::
loggers = (stupidFileLogger.stupidFileLogger(), loggers = (stupidFileLogger.stupidFileLogger(),
syslogLogger.syslogLogger(), syslogLogger.syslogLogger(),
......
...@@ -8,11 +8,11 @@ Setting the Zope "super manager" name and password ...@@ -8,11 +8,11 @@ Setting the Zope "super manager" name and password
A special "super manager" user name and password are defined outside A special "super manager" user name and password are defined outside
the application for two reasons the application for two reasons
* Some user name and password are needed to enable creation of * Some user name and password is needed to authorize creation of
initial normal managers of your Zope site. normal managers of your Zope site.
* The "super manager" provides an all-powerful user that can do * The "super manager" provides an all-powerful user that can do
anything in the application and whose password cannot be changed anything in the application, and whose password cannot be changed
through the application user interface. through the application user interface.
This user name and password is defined in the 'access' file located This user name and password is defined in the 'access' file located
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment