0

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
Quicksilver
  • 2,546
  • 3
  • 23
  • 37

1 Answers1

2

You can use Acquisition:

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