Skip to content

Commit d0b9612

Browse files
committed
Fine tune default log format
Use levelprefix for uvicorn.logging.DefaultFormatte. Move filename and position to end of line so that information is arranged in most important order from left to right within the line, where the message came from being least relevant in my thinking compared to the time, log level, and actual message.
1 parent 3348c85 commit d0b9612

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/constants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@
229229
DEFAULT_LOG_LEVEL: Final[str] = "INFO"
230230
# Default log format for plain-text logging in non-TTY environments
231231
DEFAULT_LOG_FORMAT: Final[str] = (
232-
"%(asctime)s %(levelname)-8s %(name)s:%(lineno)d %(message)s"
232+
"%(asctime)s.%(msecs)03d %(levelprefix)s %(message)s [%(name)s:%(lineno)d]"
233233
)
234234
# Environment variable to force StreamHandler instead of RichHandler
235235
# Set to any non-empty value to disable RichHandler

0 commit comments

Comments
 (0)