mirror of
https://gitea.zaclys.com/yannic/dotfiles.git
synced 2026-06-15 11:11:57 +02:00
Add pyserver logging to file (/tmp/pyserver.log)
This commit is contained in:
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user