From c57facbdc27e7a096dcd056a95d3d0c692543090 Mon Sep 17 00:00:00 2001 From: Pablo Yaniz Date: Thu, 22 Dec 2022 20:34:50 -0600 Subject: [PATCH] added optional date to log file --- rffmpeg | 5 +++++ rffmpeg.yml.sample | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/rffmpeg b/rffmpeg index 60d769b..ec7dc9e 100755 --- a/rffmpeg +++ b/rffmpeg @@ -108,6 +108,11 @@ def load_config(): # Parse the keys from the logging group config["log_to_file"] = config_logging.get("log_to_file", True) config["logfile"] = config_logging.get("logfile", "/var/log/jellyfin/rffmpeg.log") + config["logfiledated"] = config_logging.get("logfiledated", False) + if config["logfiledated"] is True: + config["logfile"] = config_logging.get("logfile", "/var/log/jellyfin/"+ (datetime.today()).strftime('%Y%m%d') +"_rffmpeg.log") + else: + config["logfile"] = config_logging.get("logfile", "/var/log/jellyfin/rffmpeg.log") config["logdebug"] = config_logging.get("debug", False) # Parse the keys from the state group diff --git a/rffmpeg.yml.sample b/rffmpeg.yml.sample index d5b4602..21aaf8b 100644 --- a/rffmpeg.yml.sample +++ b/rffmpeg.yml.sample @@ -15,7 +15,10 @@ rffmpeg: # Log messages to this file. # Ensure the user running rffmpeg can write to this directory. #logfile: "/var/log/jellyfin/rffmpeg.log" - + + # You can add the date to the logfile if you prefer to have one file per day. + #logfiledated: false + # Show debugging messages #debug: false