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-0.12.5.tar.gz (166.0 kB view details)

Uploaded Source

Built Distributions

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

Logbook-0.12.5-cp35-none-win_amd64.whl (88.9 kB view details)

Uploaded CPython 3.5Windows x86-64

Logbook-0.12.5-cp35-none-win32.whl (85.5 kB view details)

Uploaded CPython 3.5Windows x86

Logbook-0.12.5-cp34-none-win_amd64.whl (87.9 kB view details)

Uploaded CPython 3.4Windows x86-64

Logbook-0.12.5-cp34-none-win32.whl (85.7 kB view details)

Uploaded CPython 3.4Windows x86

Logbook-0.12.5-cp33-none-win_amd64.whl (87.8 kB view details)

Uploaded CPython 3.3Windows x86-64

Logbook-0.12.5-cp33-none-win32.whl (85.7 kB view details)

Uploaded CPython 3.3Windows x86

Logbook-0.12.5-cp27-none-win_amd64.whl (87.3 kB view details)

Uploaded CPython 2.7Windows x86-64

Logbook-0.12.5-cp27-none-win32.whl (84.9 kB view details)

Uploaded CPython 2.7Windows x86

Logbook-0.12.5-cp26-none-win_amd64.whl (87.6 kB view details)

Uploaded CPython 2.6Windows x86-64

Logbook-0.12.5-cp26-none-win32.whl (85.0 kB view details)

Uploaded CPython 2.6Windows x86

File details

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

File metadata

  • Download URL: Logbook-0.12.5.tar.gz
  • Upload date:
  • Size: 166.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for Logbook-0.12.5.tar.gz
Algorithm Hash digest
SHA256 3567eca498179609433f9dba0dea3d07a74d79822c1e086340dfcd33eb8a8d7e
MD5 1bf64289b9b4cada5a61817c63dd9e82
BLAKE2b-256 a8871d2b53d1822be8da3befa4dda32ee30a4dd63571e21edc28892ec6146605

See more details on using hashes here.

File details

Details for the file Logbook-0.12.5-cp35-none-win_amd64.whl.

File metadata

File hashes

Hashes for Logbook-0.12.5-cp35-none-win_amd64.whl
Algorithm Hash digest
SHA256 2921afa557e00811fb4b9902629b34615ea9d17bb6493405759444e839f46f27
MD5 bd5420d8364e8116e4eff9a825cabbbf
BLAKE2b-256 505f323ed59094d8f5d2f0c8aaffe949a05bbd6e2517ff147791a281b636010b

See more details on using hashes here.

File details

Details for the file Logbook-0.12.5-cp35-none-win32.whl.

File metadata

File hashes

Hashes for Logbook-0.12.5-cp35-none-win32.whl
Algorithm Hash digest
SHA256 b0142da22636e7d0e85c4473c98e364c3355cef7d0f413198e3997ebd058589e
MD5 00f642bf73289bce2f5e011a0bdac5d6
BLAKE2b-256 b899c3ce44dd075d82a3c1fbd6256f9ed4a4df379e3eb8a3e1fa2242b5e73b25

See more details on using hashes here.

File details

Details for the file Logbook-0.12.5-cp34-none-win_amd64.whl.

File metadata

File hashes

Hashes for Logbook-0.12.5-cp34-none-win_amd64.whl
Algorithm Hash digest
SHA256 7a9aa2d187b83d44d59328cb17a65bfb28b02dfd5c67bdc64839a4712dad1ae6
MD5 b32a20bda2c539cbc26a5ce731113b8b
BLAKE2b-256 357d58a24f9c065577771930ab0826233827f7b1dc27a366b121a59c6e91a080

See more details on using hashes here.

File details

Details for the file Logbook-0.12.5-cp34-none-win32.whl.

File metadata

File hashes

Hashes for Logbook-0.12.5-cp34-none-win32.whl
Algorithm Hash digest
SHA256 79fa6ff42dd8476cc23bdf9a103f72e6a067f5c033d7f734cb1c5ea8e4bc63b2
MD5 4420b6cbc02a7fc813126da17df13925
BLAKE2b-256 6f34e5a005aa218b8004777c9c405f885b2e4b8d5ade6a9df80de399d6a5072c

See more details on using hashes here.

File details

Details for the file Logbook-0.12.5-cp33-none-win_amd64.whl.

File metadata

File hashes

Hashes for Logbook-0.12.5-cp33-none-win_amd64.whl
Algorithm Hash digest
SHA256 174faace857ed274ce59aad559c3fd6d44c4c6d280acd45c39fe2273b80aff65
MD5 e1a23d043ad074c5690a2fdc62a23cf1
BLAKE2b-256 b08407c4af9013c7f6abd84aac16de6ea423f22d7abcf4b3e653dbd8e5961b75

See more details on using hashes here.

File details

Details for the file Logbook-0.12.5-cp33-none-win32.whl.

File metadata

File hashes

Hashes for Logbook-0.12.5-cp33-none-win32.whl
Algorithm Hash digest
SHA256 1a9f0083252f96943d95de91ed90ae2c66eb0990677cfe1cc142058a5db4f2cd
MD5 5037ad14ed683f74c82447e69b8c4c38
BLAKE2b-256 197346160d2dedbadc590b8b12bef55872c1cfc3d35291cb1baed6df626fa2fb

See more details on using hashes here.

File details

Details for the file Logbook-0.12.5-cp27-none-win_amd64.whl.

File metadata

File hashes

Hashes for Logbook-0.12.5-cp27-none-win_amd64.whl
Algorithm Hash digest
SHA256 4da4f7970ec2cffdaf8f401774f5a34a1c1406f9aa56e5eac1682a2045d701e2
MD5 06ee72e4b48a55e7019f8f6e63f7fbc6
BLAKE2b-256 a12f0700d32d02742ee07223925eb45a4540b29fbe539434e439cf167c610bc6

See more details on using hashes here.

File details

Details for the file Logbook-0.12.5-cp27-none-win32.whl.

File metadata

File hashes

Hashes for Logbook-0.12.5-cp27-none-win32.whl
Algorithm Hash digest
SHA256 1d09cebbd84f75fc99056f6b06aac1c76412182f485317565523389187049287
MD5 2e8e3fdcf168ba48ca9e53b9de48ad4c
BLAKE2b-256 44e387375f4d79fba427a61d4c0fa3bf3f1f92b43c91745b718efbac1a7b4392

See more details on using hashes here.

File details

Details for the file Logbook-0.12.5-cp26-none-win_amd64.whl.

File metadata

File hashes

Hashes for Logbook-0.12.5-cp26-none-win_amd64.whl
Algorithm Hash digest
SHA256 6d97064e27716fe7e0b149ddfc05b270243d08a1a067d474c8b384580f50f678
MD5 705d2c2123fc3779236826b5215acdbf
BLAKE2b-256 d79612d21777f5f275885ede7273ed49ee714d3f3c5b17a8698fb16ad9dd833f

See more details on using hashes here.

File details

Details for the file Logbook-0.12.5-cp26-none-win32.whl.

File metadata

File hashes

Hashes for Logbook-0.12.5-cp26-none-win32.whl
Algorithm Hash digest
SHA256 779c772aa27ca48aa1b5877bc6d2f112217abdc18bb2d2f927676d03aae368a0
MD5 02e48aeccb21ee1899840edea17b945b
BLAKE2b-256 b066cfd7bcb6e0ecffdde750b9c573e7469e6ab965857a661d32726df10cd3c5

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