Skip to content

Commit

Permalink
Log web-admin with timestamps
Browse files Browse the repository at this point in the history
  • Loading branch information
coretl committed Jan 30, 2020
1 parent d4303be commit 96cc3cb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions rootfs/web-admin/admin-server.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,12 @@
ROOTFS = '/boot/imagefile.cpio.gz'

# Log to a rotating file
extended_formatter = logging.Formatter(
"""%(asctime)s - %(levelname)6s - %(name)s
%(message)s""")
file_handler = logging.handlers.RotatingFileHandler(
LOG_FILE, maxBytes=1000000, backupCount=4)
file_handler.setFormatter(extended_formatter)
logging.root.addHandler(file_handler)
logging.root.setLevel(logging.INFO)
logging.info("Loading web-admin...")
Expand Down

0 comments on commit 96cc3cb

Please sign in to comment.