Skip to content

Commit

Permalink
fixes #3186: check that the section handler_timed_file_handler exists…
Browse files Browse the repository at this point in the history
… before trying to modify it

Signed-off-by: Ricky Ng-Adam <[email protected]>
  • Loading branch information
rngadam committed Aug 20, 2024
1 parent 277e958 commit c22911e
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions aries_cloudagent/config/logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,18 +119,19 @@ def fileConfig(
raise RuntimeError(f"{fname} is invalid: {e}")

if new_file_path:
cp.set(
"handler_timed_file_handler",
"args",
str(
(
f"{new_file_path}",
"d",
7,
1,
)
),
)
if cp.has_section("handler_timed_file_handler"):
cp.set(
"handler_timed_file_handler",
"args",
str(
(
f"{new_file_path}",
"d",
7,
1,
)
),
)

formatters = _create_formatters(cp)
with logging._lock:
Expand Down

0 comments on commit c22911e

Please sign in to comment.