ChopChop is a simple app for viewing and filtering events logged into MongoDb.
Python JavaScript
Latest commit 61f03df Jan 9, 2012 @starenka Merge pull request #1 from Formulka/master
css fix iOS, Safari

ChopChop : Simple web interface to list & filter your centralized logs

ChopChop is a simple app for viewing and filtering events logged into MongoDb. It's build on Flask (, Jinja2 ( and Mongokit ( I've used CouchDB's admin interface fancy design & graphics.

The app expects the log table to have columns used by python logging module extension for MongoDb log4mongo ( so typical row looks like:

{   "_id" : ObjectId("4e9dc89b4379463df4000001"),
    "lineNumber" : 70,
    "thread" : NumberLong("139816043067136"),
    "level" : "INFO",
    "timestamp" : { "t" : 1318963355000, "i" : 886 },
    "message" : "Job finished ['./', '-r', '-t'], time elapsed 0:00:00.143399",
    "fileName" : "/xxx/",
    "method" : "close_job",
    "loggerName" : "meh"

nevertheless you can modify the template to suit your "scheme" in a breeze.

To see it in action, try this screenshot


To setup the app, just edit your settings either in settings/ (used both on dev and production), settings/ or settings/ to suit your needs. If you edit be sure to copy it as in order to get loaded during development.

The WSGI file should work w/out any tuning. Consult your web server docs to make wsgi work with your server. Sample vhost file for Apache would look like this:

root@kosmik1:/home/starenka# cat /etc/apache2/sites-available/logs.localhost
        ServerName logs.localhost
            WSGIDaemonProcess chopchop user=starenka group=starenka threads=5
            WSGIScriptAlias / /www/chopchop/app.wsgi

            <Directory /www/chopchop>
                WSGIProcessGroup chopchop
                WSGIApplicationGroup %{GLOBAL}
                WSGIScriptReloading On
                Order deny,allow
                Allow from all

As for nginx and uWSGI & supervisor your config would look like this:


  --socket /www/logs/uwsgi.sock
  --pythonpath /www/logs
  --touch-reload /www/logs/app.wsgi
  --chmod-socket 666
  --uid starenka
  --gid starenka
  --processes 1
  --max-requests 5000
  --module chopchop
  --callable app


server {
        listen       80;
        root    /www/logs/;

        access_log  /www/logs/access.log;
        error_log /www/logs/error.log;

        location / {
                uwsgi_pass unix:///www/logs/uwsgi.sock;
                include        uwsgi_params;

        location /static {
                alias /www/logs/static;

Have fun!