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