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.2

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.2
File Size Uploaded Provenance Actions
Logbook-1.3.2.tar.gz 84.1 kB Without provenance Details for Logbook-1.3.2.tar.gz

Built distributions (wheels)

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

Total release size: 710.7 kB

Release files / Logbook-1.3.2.tar.gz

Download URL Logbook-1.3.2.tar.gz
Size 84.1 kB
Tags Source
SHA-256 checksum
How to use checksums
5f54a196a92d2f226965738158d55e8fb587127e8216e7ca6bbae2c733eef16e
BLAKE2b-256 checksum
How to use checksums
45ee5d3dadc7bca4723ccd9c9ec22ed1f1f8f2cc80b9c1405760ee9a1ab1477d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

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

Download URL Logbook-1.3.2-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
05af5f25247cfe68ee5d1d366c0c2ec1f0cb601d98930097576d0ee61c438e91
BLAKE2b-256 checksum
How to use checksums
40b106b61cd943561322589200924b61c485a3916da37459f9952422803299ec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

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

Download URL Logbook-1.3.2-cp36-cp36m-win32.whl
Size 100.8 kB
Tags CPython 3.6 CPython 3.6 pymalloc Windows x86-32
SHA-256 checksum
How to use checksums
cbc8f344db394d9b71d64faf1983eaeddcacde15219749db3ed055dc8837379d
BLAKE2b-256 checksum
How to use checksums
254bfd41c2c02c929d5c66d2d8c5efb0a69bd0eb3dab9bccf90d2ce7179f8a80
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

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

Download URL Logbook-1.3.2-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
c5f185affa8f79701b8c9d1349debc2f852433eb016ef0c0098061f7e80a6633
BLAKE2b-256 checksum
How to use checksums
c85da50ab675356e5067e2b5f248b06a11ca79a817f0a4ecad9b51476bc2aebd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

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

Download URL Logbook-1.3.2-cp35-cp35m-win32.whl
Size 100.3 kB
Tags CPython 3.5 CPython 3.5 pymalloc Windows x86-32
SHA-256 checksum
How to use checksums
c16bec0b8e14907598ad739f2b4e52c468111dea3c27cfe4e2e322a84725eba7
BLAKE2b-256 checksum
How to use checksums
3581c55b0f2fde2153821997e27e44ff98270ea0e342deb950dd116a9351e794
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

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

Download URL Logbook-1.3.2-cp27-cp27m-win_amd64.whl
Size 107.0 kB
Tags CPython 2.7 CPython 2.7 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
f5eba55fe4e11b4d152ddf4e8e9f960673ad510ba083963a4245e326f35d71a8
BLAKE2b-256 checksum
How to use checksums
4f2526c70b3ebe086a698ed74ec8bc75e44bf12a5784fa3eb010ba60f46d7637
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

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

Download URL Logbook-1.3.2-cp27-cp27m-win32.whl
Size 101.2 kB
Tags CPython 2.7 CPython 2.7 pymalloc Windows x86-32
SHA-256 checksum
How to use checksums
4296e8080a7b15b4686b677c500545a75a6e46f22bfe9d32a6e6ba91b9f806c8
BLAKE2b-256 checksum
How to use checksums
739805613ba440ab5ea28f0a5a1de34cb5402704c8d97486537421de84ac26ac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for Logbook 1.3.2

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.2 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