diff --git a/tools/frr-reload.py b/tools/frr-reload.py index ef92e8b59faf..d5f7ea8c490a 100755 --- a/tools/frr-reload.py +++ b/tools/frr-reload.py @@ -1904,6 +1904,11 @@ def compare_context_objects(newconf, running): help="Used by topotest to not delete debug or log file commands", ) + parser.add_argument( + "--logfile", help="logfile for frr-reload", + default="/var/log/frr/frr-reload.log" + ) + args = parser.parse_args() # Logging @@ -1921,11 +1926,11 @@ def compare_context_objects(newconf, running): ) elif args.reload: - if not os.path.isdir("/var/log/frr/"): - os.makedirs("/var/log/frr/", mode=0o0755) + if not os.path.isdir(os.path.dirname(args.logfile)): + os.makedirs(os.path.dirname(args.logfile), mode=0o0755) logging.basicConfig( - filename="/var/log/frr/frr-reload.log", + filename=args.logfile, format="%(asctime)s %(levelname)5s: %(message)s", )