diff --git a/server/brewpi.py b/server/brewpi.py index 3b46c05..334f013 100755 --- a/server/brewpi.py +++ b/server/brewpi.py @@ -66,8 +66,14 @@ if __name__ == '__main__': os.makedirs(args.logdir, exist_ok=True) log_path = f"{args.logdir}/brewpi.{time.strftime("%Y%m%d%H%M%S", time.localtime())}.log" log_file = open(log_path, "a", buffering=1) - sys.stdout = Tee(sys.stdout, log_file) - sys.stderr = Tee(sys.stderr, log_file) + # Fixed (no-date) name written alongside the dated one - always + # truncated and re-mirrored, so a tail-style consumer can point at one + # unchanging path instead of tracking this run's own timestamped + # filename (same principle as ServerLogTask/SudLogTask's log_latest*.json). + latest_log_path = f"{args.logdir}/brewpi.latest.log" + latest_log_file = open(latest_log_path, "w", buffering=1) + sys.stdout = Tee(sys.stdout, log_file, latest_log_file) + sys.stderr = Tee(sys.stderr, log_file, latest_log_file) print("Logging to {}".format(log_path)) config = json.load(open(args.config))