Add pyserver logging to file (/tmp/pyserver.log)
This commit is contained in:
parent
29592545f7
commit
d2913b4ac0
1 changed files with 2 additions and 0 deletions
|
@ -29,6 +29,8 @@ class S(BaseHTTPRequestHandler):
|
|||
|
||||
def run(server_class=HTTPServer, handler_class=S, port=8080):
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
fh = logging.FileHandler('/tmp/pyserver.log')
|
||||
logging.getLogger().addHandler(fh)
|
||||
server_address = ('', port)
|
||||
httpd = server_class(server_address, handler_class)
|
||||
logging.info('Starting httpd...\n')
|
||||
|
|
Loading…
Add table
Reference in a new issue