Skip to main content

A logging replacement for Python

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Logbook-1.5.2.tar.gz (85.7 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

Logbook-1.5.2-cp37-cp37m-win_amd64.whl (115.8 kB view details)

Uploaded CPython 3.7mWindows x86-64

Logbook-1.5.2-cp37-cp37m-win32.whl (107.9 kB view details)

Uploaded CPython 3.7mWindows x86

Logbook-1.5.2-cp36-cp36m-win_amd64.whl (115.8 kB view details)

Uploaded CPython 3.6mWindows x86-64

Logbook-1.5.2-cp36-cp36m-win32.whl (107.9 kB view details)

Uploaded CPython 3.6mWindows x86

Logbook-1.5.2-cp35-cp35m-win_amd64.whl (113.5 kB view details)

Uploaded CPython 3.5mWindows x86-64

Logbook-1.5.2-cp35-cp35m-win32.whl (104.1 kB view details)

Uploaded CPython 3.5mWindows x86

Logbook-1.5.2-cp27-cp27m-win_amd64.whl (111.4 kB view details)

Uploaded CPython 2.7mWindows x86-64

Logbook-1.5.2-cp27-cp27m-win32.whl (104.5 kB view details)

Uploaded CPython 2.7mWindows x86

File details

Details for the file Logbook-1.5.2.tar.gz.

File metadata

  • Download URL: Logbook-1.5.2.tar.gz
  • Upload date:
  • Size: 85.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.1.0 requests-toolbelt/0.9.1 tqdm/4.34.0 CPython/3.7.1

File hashes

Hashes for Logbook-1.5.2.tar.gz
Algorithm Hash digest
SHA256 1aeb299401d9fe228f204d83073f0ec240e3ae0d50295bf8e5be91a9cd8b7a57
MD5 9fdaa126c21be04d936834abb0cb499d
BLAKE2b-256 6b3ff4e6693791efacc1282852fba5392da0649b19416b37422c5489f79a52ea

See more details on using hashes here.

File details

Details for the file Logbook-1.5.2-cp37-cp37m-win_amd64.whl.

File metadata

  • Download URL: Logbook-1.5.2-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 115.8 kB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.1.0 requests-toolbelt/0.9.1 tqdm/4.34.0 CPython/3.7.4

File hashes

Hashes for Logbook-1.5.2-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 de2ede3732a47b6940af1299b5a61524f570fe314a8d9f0cb5646bd7b33a11c6
MD5 7e74ab7cafc850ddb2f59aa11e57bf81
BLAKE2b-256 8f4acf3cf87eee2e7baa04641920b0ad3621eeb193468c47892312a93051b163

See more details on using hashes here.

File details

Details for the file Logbook-1.5.2-cp37-cp37m-win32.whl.

File metadata

  • Download URL: Logbook-1.5.2-cp37-cp37m-win32.whl
  • Upload date:
  • Size: 107.9 kB
  • Tags: CPython 3.7m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.1.0 requests-toolbelt/0.9.1 tqdm/4.34.0 CPython/3.7.4

File hashes

Hashes for Logbook-1.5.2-cp37-cp37m-win32.whl
Algorithm Hash digest
SHA256 f4c1cbac42b532961e40439d1061ab9c61546851ce9b3a4ab7ed5ef05acfb07d
MD5 357dabcfeb4e3c1d35acb4f43df2035c
BLAKE2b-256 86fbab47bef4dc0c4fabfafbebfbcfa748a614cb41c3ab64e41cc0e493d45b24

See more details on using hashes here.

File details

Details for the file Logbook-1.5.2-cp36-cp36m-win_amd64.whl.

File metadata

  • Download URL: Logbook-1.5.2-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 115.8 kB
  • Tags: CPython 3.6m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.1.0 requests-toolbelt/0.9.1 tqdm/4.34.0 CPython/3.6.8

File hashes

Hashes for Logbook-1.5.2-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 a4192853721f25f543040ea0da010b8df630a5d1f07a2ad9bbd5556c41b04ff6
MD5 83e0b5d65598e5eb44fb1c3503dfbc91
BLAKE2b-256 3662cd4120be01e5fa3abf51f2a4f103947ae0963c8df6e915859a660c8abe1e

See more details on using hashes here.

File details

Details for the file Logbook-1.5.2-cp36-cp36m-win32.whl.

File metadata

  • Download URL: Logbook-1.5.2-cp36-cp36m-win32.whl
  • Upload date:
  • Size: 107.9 kB
  • Tags: CPython 3.6m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.1.0 requests-toolbelt/0.9.1 tqdm/4.34.0 CPython/3.6.8

File hashes

Hashes for Logbook-1.5.2-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 6dec7a1aac0efa86c04160d8c2602724b95109c0a84492c41bd30efab240ee56
MD5 f38ea713bf3a494f96e741390d8eea4d
BLAKE2b-256 560f1d8ac4d904f20a5e9011aa6d280901770db4b387f9c7d533d09f52b812ef

See more details on using hashes here.

File details

Details for the file Logbook-1.5.2-cp35-cp35m-win_amd64.whl.

File metadata

  • Download URL: Logbook-1.5.2-cp35-cp35m-win_amd64.whl
  • Upload date:
  • Size: 113.5 kB
  • Tags: CPython 3.5m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.1.0 requests-toolbelt/0.9.1 tqdm/4.34.0 CPython/3.5.4

File hashes

Hashes for Logbook-1.5.2-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 2afa44c20465a6629a96f8590910afe7eab1fb5bcd19e1eaf75c92c51428d835
MD5 dee055bb69137a3ffb76b233590308bd
BLAKE2b-256 3657bf62ecd987f2d92165d53f1418ac973081bbf68f5f90d03ce27e99d4d744

See more details on using hashes here.

File details

Details for the file Logbook-1.5.2-cp35-cp35m-win32.whl.

File metadata

  • Download URL: Logbook-1.5.2-cp35-cp35m-win32.whl
  • Upload date:
  • Size: 104.1 kB
  • Tags: CPython 3.5m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.1.0 requests-toolbelt/0.9.1 tqdm/4.34.0 CPython/3.5.4

File hashes

Hashes for Logbook-1.5.2-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 6fb3543e972acb3460fac489db4a1718400226e500dfe4d72990e77cca311549
MD5 6870f53e6572d7f2657013fb4cfa02ac
BLAKE2b-256 38360ee53865d7e3c1ae2e49e403e1353e4347f2318676f0b3f12fee687216a8

See more details on using hashes here.

File details

Details for the file Logbook-1.5.2-cp27-cp27m-win_amd64.whl.

File metadata

  • Download URL: Logbook-1.5.2-cp27-cp27m-win_amd64.whl
  • Upload date:
  • Size: 111.4 kB
  • Tags: CPython 2.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.1.0 requests-toolbelt/0.9.1 tqdm/4.34.0 CPython/2.7.16

File hashes

Hashes for Logbook-1.5.2-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 2d1c4ffd26b2c11587a028b3905aaaa0dc43943106755c3989364553ed6d17c2
MD5 53c9d691c88f93cc56fcedd0fbde4e7c
BLAKE2b-256 4810263b3391f76aa477830daf77e11aceb47dc26f278fa3f777eac6b46f9b83

See more details on using hashes here.

File details

Details for the file Logbook-1.5.2-cp27-cp27m-win32.whl.

File metadata

  • Download URL: Logbook-1.5.2-cp27-cp27m-win32.whl
  • Upload date:
  • Size: 104.5 kB
  • Tags: CPython 2.7m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.1.0 requests-toolbelt/0.9.1 tqdm/4.34.0 CPython/2.7.16

File hashes

Hashes for Logbook-1.5.2-cp27-cp27m-win32.whl
Algorithm Hash digest
SHA256 0b523cc67171b273ceb7ea2a530b103793b36941abc70e4f285ea1583d165638
MD5 fd60abfe6062afa0eb4d2617abc487db
BLAKE2b-256 fa7d6eaa7a34e4c79cb90bc5d2edd2bac024fee298b6a9d93d3a204acec7ba3e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page