liveBook · Manning

Logging module

Also called logging library, logging framework

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

How 5 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
Uses logging to preserve application events and provide real-time feedback during development.
How deep it goes
Walks through logger creation, handlers, levels, and formatting, while only briefly noting specialized handlers.
Examples
Logs a task’s database removal, sends a warning to file and console, and formats task-application events.
What you can do after
Operate and configure Python logging with named loggers, file and stream handlers, severity thresholds, and formatters.

Read how Python How-To explains logging module →

Software Engineering for Data Scientists

logging is Python's standard library module for recording diagnostic messages to streams or files at configurable severity levels.

How it is used
Supports monitoring and debugging of production code, especially machine learning pipelines.
How deep it goes
Defines severity levels and configures file output, formatting, and pipeline checkpoints, without detailing logging internals.
Examples
Uses critical, error, warning, and info messages plus customer churn pipeline logs for successful and failed runs.
What you can do after
Operate/configure logging for a pipeline and diagnose missing configuration or incomplete execution from recorded messages.

Read how Software Engineering for Data Scientists 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 →

Also covered in

What to know first

Related concepts

Questions about logging module

What is logging module?

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

Which Manning books explain logging module?

The Well-Grounded Python Developer: How the pros use Python and Flask, Python How-To, Software Engineering for Data Scientists, The Art of Code and ASP.NET Core in Action, 3e.

What should I know before learning logging module?

Manning books that teach logging module usually introduce Python, monitoring, JavaScript and production first.

What kinds of logging module are there?

Kinds of logging module include Log4j.

What are the parts of logging module?

Logging module includes FileHandler.

What is logging module also called?

Logging module is also called logging library or logging framework.

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.