Quicksilver
Quicksilver

Reputation: 2700

Reading recent log entries in zope server

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

Answers (1)

user2665694
user2665694

Reputation:

You can use Acquisition:

for err in context.error_log.getLogEntries():
    print err

Upvotes: 2

Related Questions