Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

Download
ActivePython
INSTALL>
pypm install logbook

How to install Logbook

  1. Download and install ActivePython
  2. Open Command Prompt
  3. Type pypm install logbook
 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
0.4
0.5.0Never BuiltWhy not?
0.4 Available View build log
0.3 Available View build log
0.2.1 Available View build log
0.2 Available View build log
0.1 Available View build log
0.3
0.5.0Never BuiltWhy not?
0.3 Available View build log
Windows (64-bit)
0.4
0.5.0Never BuiltWhy not?
0.4 Available View build log
0.3 Available View build log
0.2.1 Available View build log
0.2 Available View build log
0.1 Available View build log
0.3
0.5.0Never BuiltWhy not?
0.3 Available View build log
Mac OS X (10.5+)
0.4
0.5.0Never BuiltWhy not?
0.4 Available View build log
0.3 Available View build log
0.2.1 Available View build log
0.2 Available View build log
0.1 Available View build log
0.3
0.5.0Never BuiltWhy not?
0.3 Available View build log
Linux (32-bit)
0.5.0 Available View build log
0.4 Available View build log
0.3 Available View build log
0.2.1 Available View build log
0.2 Available View build log
0.1 Available View build log
0.3
0.5.0Never BuiltWhy not?
0.3 Available View build log
Linux (64-bit)
0.5.0 Available View build log
0.4.1 Available View build log
0.4 Available View build log
0.3 Available View build log
0.2.1 Available View build log
0.2 Available View build log
0.1 Available View build log
0.3
0.5.0Never BuiltWhy not?
0.3 Available View build log
0.5.0 Available View build log
 
License
BSD
Lastest release
version 0.5.0 on Aug 14th, 2013

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.

Subscribe to package updates

Last updated Aug 14th, 2013

Download Stats

Last month:4

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.