waigani
waigani

Reputation: 3580

CherryPy server errors log

Where does the CherryPy server write its error logs to? I have installed CherryPy and fired up the server with python3.2

    from cherrypy import wsgiserver

    def my_crazy_app(environ, start_response):
        status = '200 OK'
        response_headers = [("Content-type","text/plain")]
        start_response(status, response_headers)
        return ['Hello world!']

    server = wsgiserver.CherryPyWSGIServer(
                ('0.0.0.0', 80), my_crazy_app,
                server_name='www.cherrypy.example')
    server.start()

When I go to the url the page does not load and no errors are printed.

Upvotes: 3

Views: 3890

Answers (1)

Andrew Kloos
Andrew Kloos

Reputation: 4578

You need to specify the error or access log file name. You can do so in a config file...

[global]
log.error_file = 'Web.log'
log.access_file = 'Access.log'

or in a Python file...

cherrypy.config.update({'log.error_file': 'Web.log',
                'log.access_file': 'Access.log'
               })

I'm thinking your getting a "Port 80 not free" error. Try changing your port to 8080.

Andrew

Upvotes: 6

Related Questions