Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZODB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Nicolas Wavrant
ZODB
Commits
bd83764d
Commit
bd83764d
authored
Jan 23, 2003
by
Fred Drake
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refine the log handlers in the zLOG schema component a bit to make
configuration files easier to read.
parent
562d9c29
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
9 deletions
+9
-9
src/zLOG/component.xml
src/zLOG/component.xml
+5
-5
src/zLOG/datatypes.py
src/zLOG/datatypes.py
+4
-4
No files found.
src/zLOG/component.xml
View file @
bd83764d
...
@@ -22,7 +22,7 @@
...
@@ -22,7 +22,7 @@
<sectiontype
name=
"syslog"
datatype=
".syslog_handler"
<sectiontype
name=
"syslog"
datatype=
".syslog_handler"
implements=
"loghandler"
extends=
"base-log-handler"
>
implements=
"loghandler"
extends=
"base-log-handler"
>
<key
name=
"facility"
default=
"user"
datatype=
".syslog_facility"
/>
<key
name=
"facility"
default=
"user"
datatype=
".syslog_facility"
/>
<key
name=
"address"
datatype=
"socket-address"
required=
"yes
"
/>
<key
name=
"address"
datatype=
"socket-address"
default=
"localhost:514
"
/>
<key
name=
"format"
default=
"%(message)s"
<key
name=
"format"
default=
"%(message)s"
datatype=
".log_format"
/>
datatype=
".log_format"
/>
</sectiontype>
</sectiontype>
...
@@ -36,7 +36,7 @@
...
@@ -36,7 +36,7 @@
<sectiontype
name=
"http-logger"
datatype=
".http_handler"
<sectiontype
name=
"http-logger"
datatype=
".http_handler"
implements=
"loghandler"
extends=
"base-log-handler"
>
implements=
"loghandler"
extends=
"base-log-handler"
>
<key
name=
"url"
default=
"
localhost
"
datatype=
".http_handler_url"
/>
<key
name=
"url"
default=
"
http://localhost/
"
datatype=
".http_handler_url"
/>
<key
name=
"method"
default=
"GET"
datatype=
".get_or_post"
/>
<key
name=
"method"
default=
"GET"
datatype=
".get_or_post"
/>
<key
name=
"format"
default=
"%(asctime)s %(message)s"
<key
name=
"format"
default=
"%(asctime)s %(message)s"
datatype=
".log_format"
/>
datatype=
".log_format"
/>
...
@@ -44,10 +44,10 @@
...
@@ -44,10 +44,10 @@
<sectiontype
name=
"email-notifier"
datatype=
".smtp_handler"
<sectiontype
name=
"email-notifier"
datatype=
".smtp_handler"
implements=
"loghandler"
extends=
"base-log-handler"
>
implements=
"loghandler"
extends=
"base-log-handler"
>
<key
name=
"from
addr"
required=
"yes
"
/>
<key
name=
"from
"
required=
"yes"
attribute=
"fromaddr
"
/>
<multikey
name=
"to
addr
"
required=
"yes"
attribute=
"toaddrs"
/>
<multikey
name=
"to"
required=
"yes"
attribute=
"toaddrs"
/>
<key
name=
"subject"
default=
"Message from Zope"
/>
<key
name=
"subject"
default=
"Message from Zope"
/>
<key
name=
"
host
"
default=
"localhost"
datatype=
"inet-address"
/>
<key
name=
"
smtp-server
"
default=
"localhost"
datatype=
"inet-address"
/>
<key
name=
"format"
default=
"%(asctime)s %(message)s"
<key
name=
"format"
default=
"%(asctime)s %(message)s"
datatype=
".log_format"
/>
datatype=
".log_format"
/>
</sectiontype>
</sectiontype>
...
...
src/zLOG/datatypes.py
View file @
bd83764d
...
@@ -120,9 +120,9 @@ _syslog_facilities = {
...
@@ -120,9 +120,9 @@ _syslog_facilities = {
def
syslog_facility
(
value
):
def
syslog_facility
(
value
):
value
=
value
.
lower
()
value
=
value
.
lower
()
if
not
_syslog_facilities
.
has_key
(
value
):
if
not
_syslog_facilities
.
has_key
(
value
):
raise
ValueError
(
L
=
_syslog_facilities
.
keys
()
"Syslog facility must be one of "
L
.
sort
()
+
", "
.
join
(
_syslog_facilities
.
keys
()
))
raise
ValueError
(
"Syslog facility must be one of "
+
", "
.
join
(
L
))
return
value
return
value
def
syslog_handler
(
section
):
def
syslog_handler
(
section
):
...
@@ -200,7 +200,7 @@ def smtp_handler(section):
...
@@ -200,7 +200,7 @@ def smtp_handler(section):
inst
.
setFormatter
(
logging
.
Formatter
(
format
,
dateformat
))
inst
.
setFormatter
(
logging
.
Formatter
(
format
,
dateformat
))
inst
.
setLevel
(
level
)
inst
.
setLevel
(
level
)
host
,
port
=
section
.
host
host
,
port
=
section
.
smtp_server
if
not
port
:
if
not
port
:
mailhost
=
host
mailhost
=
host
else
:
else
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment