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

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.4.1
File Size Uploaded Provenance Actions
Logbook-1.4.1.tar.gz 84.6 kB Without provenance Details for Logbook-1.4.1.tar.gz

Built distributions (wheels)

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

Total release size: 721.9 kB

Release files / Logbook-1.4.1.tar.gz

Download URL Logbook-1.4.1.tar.gz
Size 84.6 kB
Tags Source
SHA-256 checksum
How to use checksums
32375ce706d04a46886f9818bb953e53e0eda636552d7c0a2e482dd670fa56db
BLAKE2b-256 checksum
How to use checksums
74fc3e7557ed1ef1bd4e3ee189fc670416abfc7192b550e8d3c1d858a63f41ab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/2.7.14

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

Download URL Logbook-1.4.1-cp36-cp36m-win_amd64.whl
Size 110.8 kB
Tags CPython 3.6 CPython 3.6 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
f6ee2eb8c169595a0101fc72f8a5d2585db2ec0562a856b02be19f5ccf426e46
BLAKE2b-256 checksum
How to use checksums
59b5ee8083c4376911d240020984a5f4dd3f9b6187fc4e79ba24ea49ff7d15b9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.6

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

Download URL Logbook-1.4.1-cp36-cp36m-win32.whl
Size 102.5 kB
Tags CPython 3.6 CPython 3.6 pymalloc Windows x86-32
SHA-256 checksum
How to use checksums
ef2e03f6144fa9aa64b8ff69678e2206f7d6788d630156737f6d66e1b2c1d319
BLAKE2b-256 checksum
How to use checksums
1a12563d8a29ce57cef03b8b608ba4a9cc5f3debe8746ed2b37ff89206ab180a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.6

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

Download URL Logbook-1.4.1-cp35-cp35m-win_amd64.whl
Size 110.4 kB
Tags CPython 3.5 CPython 3.5 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
69b461abadb1582b72eeb0db1429545d8f9fc373c3421738f31df1956ac111b2
BLAKE2b-256 checksum
How to use checksums
840153c8c78f70f8d53bc41c909333241e0cfb0d39b1d27c06c01170ebbcdc66
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.5.4

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

Download URL Logbook-1.4.1-cp35-cp35m-win32.whl
Size 102.0 kB
Tags CPython 3.5 CPython 3.5 pymalloc Windows x86-32
SHA-256 checksum
How to use checksums
2a8f9c583d7247b6f9bea7945d1d1a1bcc516b78f0e2376942201f2283191a08
BLAKE2b-256 checksum
How to use checksums
9fde86adf27160295a0f583ea34c4f0cf255e11ba19efb5c75a591336eff565c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.5.4

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

Download URL Logbook-1.4.1-cp27-cp27m-win_amd64.whl
Size 108.8 kB
Tags CPython 2.7 CPython 2.7 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
d07e4a01cfa03cfec83ad19044d122981788c88605f4d0295d56667746ee2a74
BLAKE2b-256 checksum
How to use checksums
4f5422673eed6809f749186e2654018efcd796d4b336e8c5c07a91ddff69bde4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/2.7.15

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

Download URL Logbook-1.4.1-cp27-cp27m-win32.whl
Size 102.9 kB
Tags CPython 2.7 CPython 2.7 pymalloc Windows x86-32
SHA-256 checksum
How to use checksums
78008531bca8105aae4c5a03338c4627eebbe3737bd57ab7e8ba09f134609ed5
BLAKE2b-256 checksum
How to use checksums
47553a0331c88d1bc00cc58b59d8aa0891224c7337809daa8c95fecec9b79acb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/2.7.15

Security for Logbook 1.4.1

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