[server] socketPort=80 logToScreen=0
[server] socketPort=80 logToScreen=0 logFile=/mydir/myLog.log
If these options are not enough for you (for instance, you might be running CherryPy on some embedded device with weird logging constraints), you can define your own special function called logMessage, which takes two arguments (including the optional level). The default behaviour of this function is to output the message to screen and/or to a file according to the logToScreen and logFile configuration variables.
The following code is an example of how to write your own logMessage function:
def logMessage(message, level=0): # Only print message if level < 5 if level < 5: print "Here is your message:", message CherryClass Root: mask: def index(self): <html><body>Hello</body></html>
Note that the first line def logMessage(message, level=0): has to be exactly that !
See About this document... for information on suggesting changes.