Skip to content

Commit

Permalink
Silence CryptographyDeprecationWarning (#15294)
Browse files Browse the repository at this point in the history
The asyncssh library unfortunately causes log spam on
middleware startup and leaks into /var/log/syslog.
  • Loading branch information
anodos325 authored Jan 1, 2025
1 parent 1785a62 commit e81a3aa
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/middlewared/middlewared/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import warnings
from .logging.console_formatter import ConsoleLogFormatter
from collections import deque
from cryptography.utils import CryptographyDeprecationWarning
from json import dumps
from dataclasses import dataclass
from .utils.time_utils import utc_now
Expand Down Expand Up @@ -53,6 +54,9 @@
# Excluding this default from the generated JSON schema is the correct behavior, so there is no real issue here.
warnings.filterwarnings("ignore", module="pydantic.json_schema")

# asyncssh imports various weak crypto algorithms generating log spam on every middleware start
warnings.filterwarnings("ignore", category=CryptographyDeprecationWarning)

logging.TRACE = 6

APP_LIFECYCLE_LOGFILE = '/var/log/app_lifecycle.log'
Expand Down

0 comments on commit e81a3aa

Please sign in to comment.