liveBook · Manning

Logging module

Python’s standard-library module provides configurable facilities for creating, filtering, formatting, and routing application log records.

How 4 Manning books explain it

The Well-Grounded Python Developer: How the pros use Python and Flask

The logging module is Python's standard-library module for creating, filtering, formatting, and routing diagnostic log records.

How it is used
Replaces diagnostic print statements with configurable messages for monitoring application activity and investigating problems.
How deep it goes
Works through basic logger setup and application-level configuration, including severity filtering, formatting, and STDOUT routing.
Examples
Uses a logged exception, YAML configuration, and DEBUG messages from Flask routes.
What you can do after
Operate/configure it to retain diagnostic messages while filtering DEBUG output in production and restoring it for investigation.

Read how The Well-Grounded Python Developer: How the pros use Python and Flask explains logging module →

Python How-To

The logging module is Python's standard-library module for recording application events through loggers, handlers, formatters, and severity levels.

How it is used
Records application events for immediate console feedback or later inspection in a file.
How deep it goes
Works through logger creation, file and stream handlers, severity filtering, and formatting; mentions other handler types without detailing them.
Examples
Uses a task-removal event, a saved log file, console warnings, level-filtered messages, and timestamped records.
What you can do after
Operate/configure it to route, filter, and format application records for console viewing and file storage.

Read how Python How-To explains logging module →

The Art of Code

Python's logging module is a standard-library facility for creating, filtering, formatting, and routing log records.

How it is used
Supports production diagnostics by routing filtered, formatted records to destinations suited to persistence, aggregation, and monitoring.
How deep it goes
Explains destinations, formats, filtering, severity levels, and message quality, but does not detail Python configuration APIs.
Examples
Uses console printing, stack traces, vague messages, and contextual parsing errors to contrast weak and useful diagnostics.
What you can do after
Evaluate/understand when console output is insufficient and how contextual messages improve failure investigation.

Read how The Art of Code explains logging module →

ASP.NET Core in Action, 3e

A logging library provides APIs for recording and routing diagnostic and operational messages from an application.

How it is used
Supports ASP.NET Core monitoring and troubleshooting by recording events and routing diagnostic output.
How deep it goes
Explains the architecture, dependency-injection integration, ILogger records, verbosity, and logging providers.
Examples
Uses negative shopping-cart totals, exceptions, console output, files, and external services as logging examples.
What you can do after
Diagnose application errors by creating structured log messages and routing them to suitable destinations.

Read how ASP.NET Core in Action, 3e explains logging module →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.