Reputation: 2700
How can I fetch recent log entries(errors) on python script in zope application server.
I noticed a getLogEntries() method, but don't know how to use it. Please help.
I tried running the following code.
from zope.error.error import ErrorReportingUtility
logs = ErrorReportingUtility.getLogEntries()
Got the following error
Error Type: Unauthorized
Error Value: import of 'zope.error.error' is unauthorized
Upvotes: 0
Views: 104
Reputation:
You can use Acquisition:
for err in context.error_log.getLogEntries():
print err
Upvotes: 2