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.5.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.5.3
File Size Uploaded Provenance Actions
Logbook-1.5.3.tar.gz 85.8 kB Without provenance Details for Logbook-1.5.3.tar.gz

Built distributions (wheels)

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

Total release size: 966.9 kB

Release files / Logbook-1.5.3.tar.gz

Download URL Logbook-1.5.3.tar.gz
Size 85.8 kB
Tags Source
SHA-256 checksum
How to use checksums
66f454ada0f56eae43066f604a222b09893f98c1adc18df169710761b8f32fe8
BLAKE2b-256 checksum
How to use checksums
2fd916ac346f7c0102835814cc9e5b684aaadea101560bb932a2403bd26b2320
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.1

Release files / Logbook-1.5.3-cp37-cp37m-win_amd64.whl

Download URL Logbook-1.5.3-cp37-cp37m-win_amd64.whl
Size 115.8 kB
Tags CPython 3.7 CPython 3.7 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
0cf2cdbfb65a03b5987d19109dacad13417809dcf697f66e1a7084fb21744ea9
BLAKE2b-256 checksum
How to use checksums
cd841506b46b9f2925ad0bde0795a408827e83fe0c6b68cde230e5a393fc7d0f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4

Release files / Logbook-1.5.3-cp37-cp37m-win32.whl

Download URL Logbook-1.5.3-cp37-cp37m-win32.whl
Size 108.0 kB
Tags CPython 3.7 CPython 3.7 pymalloc Windows x86-32
SHA-256 checksum
How to use checksums
8f76a2e7b1f72595f753228732f81ce342caf03babc3fed6bbdcf366f2f20f18
BLAKE2b-256 checksum
How to use checksums
ac5ff98b9fff5ed1ba37da8ee5ef2aaa65218d96a72bd82f49a3ac5e279a9075
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4

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

Download URL Logbook-1.5.3-cp36-cp36m-win_amd64.whl
Size 115.8 kB
Tags CPython 3.6 CPython 3.6 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
e18f7422214b1cf0240c56f884fd9c9b4ff9d0da2eabca9abccba56df7222f66
BLAKE2b-256 checksum
How to use checksums
885b98b4c479955225362f922650b0cafe41bae774cbfbad6f93213cd947cd0f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.8

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

Download URL Logbook-1.5.3-cp36-cp36m-win32.whl
Size 108.0 kB
Tags CPython 3.6 CPython 3.6 pymalloc Windows x86-32
SHA-256 checksum
How to use checksums
7c533eb728b3d220b1b5414ba4635292d149d79f74f6973b4aa744c850ca944a
BLAKE2b-256 checksum
How to use checksums
5faa13f5570e4e291e28ad1d9a9291433e1908dcb81e0bc2ce61cd9ae4a921a0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.8

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

Download URL Logbook-1.5.3-cp35-cp35m-win_amd64.whl
Size 113.5 kB
Tags CPython 3.5 CPython 3.5 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
97fee1bd9605f76335b169430ed65e15e457a844b2121bd1d90a08cf7e30aba0
BLAKE2b-256 checksum
How to use checksums
82390b6b4222913511d35933fe8835e38a9a927a02b1945d9ef2afc3f00aee60
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.5.4

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

Download URL Logbook-1.5.3-cp35-cp35m-win32.whl
Size 104.1 kB
Tags CPython 3.5 CPython 3.5 pymalloc Windows x86-32
SHA-256 checksum
How to use checksums
94e2e11ff3c2304b0d09a36c6208e5ae756eb948b210e5cbd63cd8d27f911542
BLAKE2b-256 checksum
How to use checksums
5f3ebd8d7100ff7575607a333ae0ab07912389b24cdf56d6b472668f987d4a62
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.5.4

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

Download URL Logbook-1.5.3-cp27-cp27m-win_amd64.whl
Size 111.5 kB
Tags CPython 2.7 CPython 2.7 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
2dc85f1510533fddb481e97677bb7bca913560862734c0b3b289bfed04f78c92
BLAKE2b-256 checksum
How to use checksums
e0f0310f15baadca036f4789fe5049f907f6cde37bcc2cf3321b611352f1396b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/2.7.16

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

Download URL Logbook-1.5.3-cp27-cp27m-win32.whl
Size 104.5 kB
Tags CPython 2.7 CPython 2.7 pymalloc Windows x86-32
SHA-256 checksum
How to use checksums
56ee54c11df3377314cedcd6507638f015b4b88c0238c2e01b5eb44fd3a6ad1b
BLAKE2b-256 checksum
How to use checksums
04611e9e05146da1d5bab629e173ba10513e0437e6be0794c83902cfbcd16dbe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/2.7.16

Security for Logbook 1.5.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.5.3 This release

9 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