Opens in a new tab

Online code guide

Python logging example

Logging configuration that preserves operational evidence and failure exit status.

Use this resource

Before you begin
A Python environment and an application whose failure behavior you can test.
How to use it
Run the example with valid input and an input that fails. Compare its ordinary output, exception record and process exit status so a calling script can distinguish success from failure.
Scope
Review what the application records before sending logs to shared storage.
All templates & downloads