Suppressing logging of a URL

17 views
Skip to first unread message

Miki

unread,
Dec 29, 2011, 1:18:51 PM12/29/11
to cherryp...@googlegroups.com
Greetings,

CherryPy by default logs access to every URL. However I'd like to suppress this logging for one specific URL which is being hit many times.
Is there a way to do that (in the _cp_config of the handler method somehow?)

Thanks,
--
Miki

Miki

unread,
Jan 5, 2012, 12:50:44 PM1/5/12
to cherryp...@googlegroups.com
I've tried settings log.access_file to None like the below, but hitting /a still produces access log line.
(per http://docs.cherrypy.org/stable/refman/_cplogging.html#cherrypy._cplogging.LogManager.access_file)

#!/usr/bin/env python

import cherrypy

class App(object):
    @cherrypy.expose
    def default(self):
        return 'default\n'

    @cherrypy.expose
    def a(self):
        return 'a\n'

if __name__ == '__main__':
    config = {
        '/a' : { 'log.access_file' : None }
    }
    cherrypy.quickstart(App(), config=config)

Reply all
Reply to author
Forward
0 new messages