Skip to content

Commit

Permalink
Fix python-json-logger deprecation warning (#2201)
Browse files Browse the repository at this point in the history
  • Loading branch information
jvstme authored Jan 20, 2025
1 parent 45a4628 commit 3bd02ab
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def get_long_description():
"alembic-postgresql-enum",
"asyncpg",
"cachetools",
"python-json-logger",
"python-json-logger>=3.1.0",
"grpcio>=1.50", # indirect
]

Expand Down
4 changes: 2 additions & 2 deletions src/dstack/_internal/server/utils/logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import logging
import sys

from pythonjsonlogger import jsonlogger
from pythonjsonlogger.json import JsonFormatter

from dstack._internal.cli.utils.common import console
from dstack._internal.cli.utils.rich import DstackRichHandler
Expand All @@ -25,7 +25,7 @@ def configure_logging():
fmt="%(levelname)s %(asctime)s.%(msecs)03d %(name)s %(message)s",
datefmt="%Y-%m-%dT%H:%M:%S",
),
"json": jsonlogger.JsonFormatter(
"json": JsonFormatter(
"%(asctime)s %(name)s %(levelname)s %(message)s",
json_ensure_ascii=False,
rename_fields={"name": "logger", "asctime": "timestamp", "levelname": "level"},
Expand Down

0 comments on commit 3bd02ab

Please sign in to comment.