mitsuhiko/logbook — pull request #54 by vals (2012-10-04 11:37:39+00:00)
Title: Feature - DatabaseHandler with CouchDB backend

Hi, here at @scilifelab we want to log some things in a data analysis pipeline in to a CouchDB database.

By using the database writing functionality from `ticketing.py` I have implemented a backend which writes the entire log record to a specified couchdb database as a document. To avoid confusion, since these would not be "tickets", I aliased `TicketHandler` as `DatabaseHandler` in `more.py`. And I put the `CouchDBBackend` in `more.py` as well.

All in all, this patch enables this functionality:

```python
from logbook import Logger
from logbook.more import DatabaseHandler
from logbook.more import CouchDBBackend

log = Logger("Testbook")
handler = DatabaseHandler('http://maggie.scilifelab.se:5984', \
backend=CouchDBBackend, \
db='logging_test')

with handler:
log.info("Hello world!")
```

We where thinking this might be useful for more people!

On a sidenote, we noticed that development seem to have decreased somewhat, and were thinking about e.g. having a look at the current pull requests to your repo and see if we should merge those, and perhaps pick up development some.