Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
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
Kirill Smelkov
Zope
Commits
9b95134c
Commit
9b95134c
authored
Aug 21, 2002
by
Shane Hathaway
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Made the list of ignored exceptions configurable through the web.
- Show the most recent log entry first.
parent
9bdf999d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
7 deletions
+26
-7
lib/python/Products/SiteErrorLog/SiteErrorLog.py
lib/python/Products/SiteErrorLog/SiteErrorLog.py
+14
-6
lib/python/Products/SiteErrorLog/www/main.pt
lib/python/Products/SiteErrorLog/www/main.pt
+12
-1
No files found.
lib/python/Products/SiteErrorLog/SiteErrorLog.py
View file @
9b95134c
...
...
@@ -13,7 +13,7 @@
##############################################################################
"""Site error log module.
$Id: SiteErrorLog.py,v 1.1
0 2002/08/14 22:25:11 mj
Exp $
$Id: SiteErrorLog.py,v 1.1
1 2002/08/21 14:23:24 shane
Exp $
"""
import
os
...
...
@@ -203,8 +203,11 @@ class SiteErrorLog (SimpleItem):
security
.
declareProtected
(
use_error_logging
,
'getProperties'
)
def
getProperties
(
self
):
return
{
'keep_entries'
:
self
.
keep_entries
,
'copy_to_zlog'
:
self
.
copy_to_zlog
}
return
{
'keep_entries'
:
self
.
keep_entries
,
'copy_to_zlog'
:
self
.
copy_to_zlog
,
'ignored_exceptions'
:
self
.
_ignored_exceptions
,
}
security
.
declareProtected
(
log_to_event_log
,
'checkEventLogPermission'
)
def
checkEventLogPermission
(
self
):
...
...
@@ -214,7 +217,8 @@ class SiteErrorLog (SimpleItem):
return
1
security
.
declareProtected
(
use_error_logging
,
'setProperties'
)
def
setProperties
(
self
,
keep_entries
,
copy_to_zlog
=
0
,
RESPONSE
=
None
):
def
setProperties
(
self
,
keep_entries
,
copy_to_zlog
=
0
,
ignored_exceptions
=
(),
RESPONSE
=
None
):
"""Sets the properties of this site error log.
"""
copy_to_zlog
=
not
not
copy_to_zlog
...
...
@@ -223,6 +227,8 @@ class SiteErrorLog (SimpleItem):
self
.
checkEventLogPermission
()
self
.
keep_entries
=
int
(
keep_entries
)
self
.
copy_to_zlog
=
copy_to_zlog
self
.
_ignored_exceptions
=
tuple
(
filter
(
None
,
map
(
str
,
ignored_exceptions
)))
if
RESPONSE
is
not
None
:
RESPONSE
.
redirect
(
'%s/manage_main?manage_tabs_message=Changed+properties.'
%
...
...
@@ -230,12 +236,14 @@ class SiteErrorLog (SimpleItem):
security
.
declareProtected
(
use_error_logging
,
'getLogEntries'
)
def
getLogEntries
(
self
):
"""Returns the entries in the log.
"""Returns the entries in the log
, most recent first
.
Makes a copy to prevent changes.
"""
# List incomprehension ;-)
return
[
entry
.
copy
()
for
entry
in
self
.
_getLog
()]
res
=
[
entry
.
copy
()
for
entry
in
self
.
_getLog
()]
res
.
reverse
()
return
res
security
.
declareProtected
(
use_error_logging
,
'getLogEntryById'
)
def
getLogEntryById
(
self
,
id
):
...
...
lib/python/Products/SiteErrorLog/www/main.pt
View file @
9b95134c
...
...
@@ -33,6 +33,17 @@ file(s).
disabled not:container/checkEventLogPermission|nothing" />
</td>
</tr>
<tr>
<td align="left" valign="top">
<div class="form-label">
Ignored exception types
</div>
</td>
<td align="left" valign="top">
<textarea name="ignored_exceptions:lines" cols="40" rows="3"
tal:content="python: '\n'.join(props['ignored_exceptions'])"></textarea>
</td>
</tr>
<tr>
<td align="left" valign="top">
</td>
...
...
@@ -45,7 +56,7 @@ file(s).
</tr>
</table>
<h3>Exception Log</h3>
<h3>Exception Log
(most recent first)
</h3>
<div tal:define="entries container/getLogEntries">
...
...
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