Skip to content

Commit

Permalink
Use constant from middlewared.logger
Browse files Browse the repository at this point in the history
  • Loading branch information
anodos325 committed Dec 31, 2024
1 parent f37bc56 commit 6a63403
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions ixdiagnose/plugins/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,7 @@
from .base import Plugin
from .metrics import PythonMetric

LOG_FILES = (
'/var/log/app_lifecycle.log',
'/var/log/app_migrations.log',
'/var/log/failover.log',
'/var/log/middlewared.log',
'/var/log/netdata_api.log',
'/var/log/zettarepl.log'
)
from middlewared.logger import ALL_LOG_FILES


def parse_log_file(path: str) -> list[dict]:
Expand All @@ -28,9 +21,9 @@ def parse_log_file(path: str) -> list[dict]:

def gather_exceptions(client: None, resource_type: str) -> dict:
results = {}
for log in LOG_FILES:
for log in ALL_LOG_FILES:
try:
results[log] = parse_log_file(log)
results[log.logfile] = parse_log_file(log.logfile)
except FileNotFoundError:
pass

Expand Down

0 comments on commit 6a63403

Please sign in to comment.