Commit 23223c9c authored by Fred Drake's avatar Fred Drake

Use the logging configuration component from ZConfig instead of the zLOG

implementation.  The configuration aspects of zLOG are about to disappear.
parent 020e4aa7
......@@ -110,9 +110,6 @@ class ZopeStarter:
def setupStartupHandler(self):
# set up our initial logging environment (log everything to stderr
# if we're not in debug mode).
import zLOG
import zLOG.EventLogger
from ZConfig.components.logger.loghandler import StartupHandler
if self.cfg.eventlog is not None:
......@@ -125,7 +122,9 @@ class ZopeStarter:
self.startup_handler = StartupHandler(sys.stderr)
self.startup_handler.setLevel(level)
formatter = zLOG.EventLogger.formatters['file']
formatter = logging.Formatter(
fmt='------\n%(asctime)s %(levelname)s %(name)s %(message)s',
datefmt='%Y-%m-%dT%H:%M:%S')
self.startup_handler.setFormatter(formatter)
if not self.cfg.debug_mode:
# prevent startup messages from going to stderr if we're not
......
......@@ -121,8 +121,6 @@ class ZopeStarterTestCase(unittest.TestCase):
starter = ZopeStarter(conf)
starter.setupStartupHandler()
self.assert_(not zLOG._call_initialize)
self.assertEqual(starter.startup_handler.formatter,
zLOG.EventLogger.formatters['file'])
# startup handler should take on the level of the event log handler
# with the lowest level
......
......@@ -53,5 +53,3 @@ def warning_filter_handler(section):
warnings.filterwarnings(section.action, section.message, section.category,
section.module, section.lineno, 1)
return section
......@@ -4,7 +4,8 @@
<!-- type definitions -->
<import package="zLOG"/>
<import package="ZConfig.components.logger" file="handlers.xml"/>
<import package="ZConfig.components.logger" file="eventlog.xml"/>
<import package="ZODB"/>
<import package="ZServer"/>
<import package="tempstorage"/>
......@@ -13,8 +14,9 @@
<sectiontype name="logger" datatype=".LoggerFactory">
<description>
This "logger" type only applies to access and request ("trace")
logging; event logging is handled by the zLOG package, which
provides the loghandler type used here.
logging; event logging is handled by the "logging" package in
the Python standard library. The loghandler type used here is
provided by the "ZConfig.components.logger" package.
</description>
<key name="level"
datatype="ZConfig.components.logger.datatypes.logging_level"
......
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