more info in log prefix

- include date, in addition to time
- show module:line
- put username in single-user log prefix

It's more information, making the log prefix pretty long now, but I think it makes sense,
given the number of log sources and likely duration of a JupyterHub instance.
This commit is contained in:
Min RK
2015-01-28 14:47:42 -08:00
parent dee8d4af00
commit e9c20c3f00
2 changed files with 12 additions and 2 deletions

View File

@@ -338,11 +338,11 @@ class JupyterHub(Application):
def _log_datefmt_default(self):
"""Exclude date from default date format"""
return "%H:%M:%S"
return "%Y-%m-%d %H:%M:%S"
def _log_format_default(self):
"""override default log format to include time"""
return "%(color)s[%(levelname)1.1s %(asctime)s.%(msecs).03d %(name)s]%(end_color)s %(message)s"
return "%(color)s[%(levelname)1.1s %(asctime)s.%(msecs).03d %(name)s %(module)s:%(lineno)d]%(end_color)s %(message)s"
def init_logging(self):
# This prevents double log messages because tornado use a root logger that