Skip to main content

Logbook

An awesome logging implementation that is fun to use.

Quickstart

from logbook import Logger
log = Logger('A Fancy Name')

log.warn('Logbook is too awesome for most applications')
log.error("Can't touch this")

Works for web apps too

from logbook import MailHandler, Processor

mailhandler = MailHandler(from_addr='servererror@example.com',
                          recipients=['admin@example.com'],
                          level='ERROR', format_string=u'''\
Subject: Application Error for {record.extra[path]} [{record.extra[method]}]

Message type:       {record.level_name}
Location:           {record.filename}:{record.lineno}
Module:             {record.module}
Function:           {record.func_name}
Time:               {record.time:%Y-%m-%d %H:%M:%S}
Remote IP:          {record.extra[ip]}
Request:            {record.extra[path]} [{record.extra[method]}]

Message:

{record.message}
''')

def handle_request(request):
    def inject_extra(record, handler):
        record.extra['ip'] = request.remote_addr
        record.extra['method'] = request.method
        record.extra['path'] = request.path

    with Processor(inject_extra):
        with mailhandler:
            # execute code that might fail in the context of the
            # request.

Metadata

Release files for Logbook 1.3.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for Logbook 1.3.3
File Size Uploaded Provenance Actions
Logbook-1.3.3.tar.gz 84.1 kB Without provenance Details for Logbook-1.3.3.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for Logbook 1.3.3
File Actions
Logbook-1.3.3-cp36-cp36m-win_amd64.whl CPython 3.6 CPython 3.6 pymalloc Windows x86-64 Details for Logbook-1.3.3-cp36-cp36m-win_amd64.whl
Logbook-1.3.3-cp36-cp36m-win32.whl CPython 3.6 CPython 3.6 pymalloc Windows x86-32 Details for Logbook-1.3.3-cp36-cp36m-win32.whl
Logbook-1.3.3-cp35-cp35m-win_amd64.whl CPython 3.5 CPython 3.5 pymalloc Windows x86-64 Details for Logbook-1.3.3-cp35-cp35m-win_amd64.whl
Logbook-1.3.3-cp35-cp35m-win32.whl CPython 3.5 CPython 3.5 pymalloc Windows x86-32 Details for Logbook-1.3.3-cp35-cp35m-win32.whl
Logbook-1.3.3-cp27-cp27m-win_amd64.whl CPython 2.7 CPython 2.7 pymalloc Windows x86-64 Details for Logbook-1.3.3-cp27-cp27m-win_amd64.whl
Logbook-1.3.3-cp27-cp27m-win32.whl CPython 2.7 CPython 2.7 pymalloc Windows x86-32 Details for Logbook-1.3.3-cp27-cp27m-win32.whl

Total release size: 711.0 kB

Release files / Logbook-1.3.3.tar.gz

Download URL Logbook-1.3.3.tar.gz
Size 84.1 kB
Tags Source
SHA-256 checksum
How to use checksums
d00abc77735dd22c85925fac9d2cbb21c2eec1839d2e58884975e14d9b351e7c
BLAKE2b-256 checksum
How to use checksums
300f28ba51875586a292b7dd9d5a095d01d3104a2a4adabe8a92bca331654c4a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / Logbook-1.3.3-cp36-cp36m-win_amd64.whl

Download URL Logbook-1.3.3-cp36-cp36m-win_amd64.whl
Size 108.9 kB
Tags CPython 3.6 CPython 3.6 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
5d9546a6ca0881167cfbe59c356ce6d9106cc14728ed79e25ea7cfa30174f8d7
BLAKE2b-256 checksum
How to use checksums
5c6f6a5d0fad73dfbe7dfb22a9dd1c4825f86b0f0f7462010776788313c3712d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / Logbook-1.3.3-cp36-cp36m-win32.whl

Download URL Logbook-1.3.3-cp36-cp36m-win32.whl
Size 100.9 kB
Tags CPython 3.6 CPython 3.6 pymalloc Windows x86-32
SHA-256 checksum
How to use checksums
affe5ac99aef0a221ff5d76352dc939b5fc370a0653e280acc2d584103ab239c
BLAKE2b-256 checksum
How to use checksums
6f934454a957b2e4e13cb94d451594cdf8f83e94284c9462f0943552cd8f34c5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / Logbook-1.3.3-cp35-cp35m-win_amd64.whl

Download URL Logbook-1.3.3-cp35-cp35m-win_amd64.whl
Size 108.4 kB
Tags CPython 3.5 CPython 3.5 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
c65734ac8b7f2e915805cc5f8c67764b9b5ad905c4f1486820f98719c77c2ba0
BLAKE2b-256 checksum
How to use checksums
daad7f6758b94125cb5857db70c86304f19d8ba61066fc690825047585baf0e9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / Logbook-1.3.3-cp35-cp35m-win32.whl

Download URL Logbook-1.3.3-cp35-cp35m-win32.whl
Size 100.4 kB
Tags CPython 3.5 CPython 3.5 pymalloc Windows x86-32
SHA-256 checksum
How to use checksums
2f8dc0544c2953c9a81d6134dcff9d25fba5d8c6d2f39d20020f29b6982e74a7
BLAKE2b-256 checksum
How to use checksums
6af854d75e92eb59a77a8b23ac5371438c7eb5b16d39f8a1146ba7ead63feb62
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / Logbook-1.3.3-cp27-cp27m-win_amd64.whl

Download URL Logbook-1.3.3-cp27-cp27m-win_amd64.whl
Size 107.1 kB
Tags CPython 2.7 CPython 2.7 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
f4a22f824ac7655b3389487f91875c15b0e3d34cd69472c2c1b86fc804d1c52b
BLAKE2b-256 checksum
How to use checksums
13713c4903fc0690059b574396e57f3d8bdf2466cd27b0b756bccd56ba7b0110
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / Logbook-1.3.3-cp27-cp27m-win32.whl

Download URL Logbook-1.3.3-cp27-cp27m-win32.whl
Size 101.3 kB
Tags CPython 2.7 CPython 2.7 pymalloc Windows x86-32
SHA-256 checksum
How to use checksums
619b86f98a6cd9aa0a9a6739744f97fa2809b11e79b4850c861a9d7007f4d303
BLAKE2b-256 checksum
How to use checksums
054a2b22edfce113eb18d01740d3206f6fee34f382d13cf9a1841babe2b2c9c3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for Logbook 1.3.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.3.3 This release

7 release files No provenance

0.12.0

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page