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.3.tar.gz (85.8 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.3-cp37-cp37m-win_amd64.whl (115.8 kB view details)

Uploaded CPython 3.7mWindows x86-64

Logbook-1.5.3-cp37-cp37m-win32.whl (108.0 kB view details)

Uploaded CPython 3.7mWindows x86

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

Uploaded CPython 3.6mWindows x86-64

Logbook-1.5.3-cp36-cp36m-win32.whl (108.0 kB view details)

Uploaded CPython 3.6mWindows x86

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

Uploaded CPython 3.5mWindows x86-64

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

Uploaded CPython 3.5mWindows x86

Logbook-1.5.3-cp27-cp27m-win_amd64.whl (111.5 kB view details)

Uploaded CPython 2.7mWindows x86-64

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

Uploaded CPython 2.7mWindows x86

File details

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

File metadata

  • Download URL: Logbook-1.5.3.tar.gz
  • Upload date:
  • Size: 85.8 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for Logbook-1.5.3.tar.gz
Algorithm Hash digest
SHA256 66f454ada0f56eae43066f604a222b09893f98c1adc18df169710761b8f32fe8
MD5 719970ea22dd274797bb4328161d700f
BLAKE2b-256 2fd916ac346f7c0102835814cc9e5b684aaadea101560bb932a2403bd26b2320

See more details on using hashes here.

File details

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

File metadata

  • Download URL: Logbook-1.5.3-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/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

File hashes

Hashes for Logbook-1.5.3-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 0cf2cdbfb65a03b5987d19109dacad13417809dcf697f66e1a7084fb21744ea9
MD5 a8b109e8a63199189eb0703e7c9e5b7f
BLAKE2b-256 cd841506b46b9f2925ad0bde0795a408827e83fe0c6b68cde230e5a393fc7d0f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: Logbook-1.5.3-cp37-cp37m-win32.whl
  • Upload date:
  • Size: 108.0 kB
  • Tags: CPython 3.7m, Windows x86
  • Uploaded using 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

File hashes

Hashes for Logbook-1.5.3-cp37-cp37m-win32.whl
Algorithm Hash digest
SHA256 8f76a2e7b1f72595f753228732f81ce342caf03babc3fed6bbdcf366f2f20f18
MD5 faa002e6b58ee75e91a18e082c827c38
BLAKE2b-256 ac5ff98b9fff5ed1ba37da8ee5ef2aaa65218d96a72bd82f49a3ac5e279a9075

See more details on using hashes here.

File details

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

File metadata

  • Download URL: Logbook-1.5.3-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/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

File hashes

Hashes for Logbook-1.5.3-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 e18f7422214b1cf0240c56f884fd9c9b4ff9d0da2eabca9abccba56df7222f66
MD5 940eb697ddf62f5c70de6d24c8e83fb4
BLAKE2b-256 885b98b4c479955225362f922650b0cafe41bae774cbfbad6f93213cd947cd0f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: Logbook-1.5.3-cp36-cp36m-win32.whl
  • Upload date:
  • Size: 108.0 kB
  • Tags: CPython 3.6m, Windows x86
  • Uploaded using 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

File hashes

Hashes for Logbook-1.5.3-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 7c533eb728b3d220b1b5414ba4635292d149d79f74f6973b4aa744c850ca944a
MD5 d294e3c2d103719cbddce7a634d63f0b
BLAKE2b-256 5faa13f5570e4e291e28ad1d9a9291433e1908dcb81e0bc2ce61cd9ae4a921a0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: Logbook-1.5.3-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.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

File hashes

Hashes for Logbook-1.5.3-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 97fee1bd9605f76335b169430ed65e15e457a844b2121bd1d90a08cf7e30aba0
MD5 a8f6ab38a445a12d87a4e6c3bf932b19
BLAKE2b-256 82390b6b4222913511d35933fe8835e38a9a927a02b1945d9ef2afc3f00aee60

See more details on using hashes here.

File details

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

File metadata

  • Download URL: Logbook-1.5.3-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.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

File hashes

Hashes for Logbook-1.5.3-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 94e2e11ff3c2304b0d09a36c6208e5ae756eb948b210e5cbd63cd8d27f911542
MD5 73d8191b3c48b832da4913bb9f790158
BLAKE2b-256 5f3ebd8d7100ff7575607a333ae0ab07912389b24cdf56d6b472668f987d4a62

See more details on using hashes here.

File details

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

File metadata

  • Download URL: Logbook-1.5.3-cp27-cp27m-win_amd64.whl
  • Upload date:
  • Size: 111.5 kB
  • Tags: CPython 2.7m, Windows x86-64
  • Uploaded using 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

File hashes

Hashes for Logbook-1.5.3-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 2dc85f1510533fddb481e97677bb7bca913560862734c0b3b289bfed04f78c92
MD5 dd05b5929b35365536517eb81b35cde1
BLAKE2b-256 e0f0310f15baadca036f4789fe5049f907f6cde37bcc2cf3321b611352f1396b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: Logbook-1.5.3-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.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

File hashes

Hashes for Logbook-1.5.3-cp27-cp27m-win32.whl
Algorithm Hash digest
SHA256 56ee54c11df3377314cedcd6507638f015b4b88c0238c2e01b5eb44fd3a6ad1b
MD5 bf0edc2c9bf0d8d7d5c87cb07c83b459
BLAKE2b-256 04611e9e05146da1d5bab629e173ba10513e0437e6be0794c83902cfbcd16dbe

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