Merge pull request #43 from pyaniz/master

Added Functionality to set date to log files
This commit is contained in:
Joshua M. Boniface 2022-12-23 15:16:56 -05:00 committed by GitHub
commit 9a2ad2f7e2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 0 deletions

View file

@ -35,6 +35,7 @@ from re import search
from sqlite3 import connect as sqlite_connect
from subprocess import run, PIPE
from time import sleep
from datetime import datetime
# Set up the logger
@ -108,6 +109,10 @@ 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["datedlogfiles"] = config_logging.get("datedlogfiles", False)
if config["datedlogfiles"] is True:
config["datedlogdir"] = config_logging.get("datedlogdir", "/var/log/jellyfin")
config["logfile"] = f"{config['datedlogdir']}/{datetime.today().strftime('%Y%m%d')}_rffmpeg.log"
config["logdebug"] = config_logging.get("debug", False)
# Parse the keys from the state group

View file

@ -15,6 +15,14 @@ rffmpeg:
# Log messages to this file.
# Ensure the user running rffmpeg can write to this directory.
#logfile: "/var/log/jellyfin/rffmpeg.log"
# Use a Jellyfin-logging compatible dated log format, e.g. "20221223_rffmpeg.log"
# Supersedes the "logfile" directive above
#datedlogfiles: false
# Use this base directory for Jellyfin-logging compatible dated log files if you enable "datedlogfiles"
# Set this to your Jellyfin logging directory if it differs from the default
#datedlogdir: /var/log/jellyfin
# Show debugging messages
#debug: false