vllm.logger
Logging configuration for vLLM.
DEFAULT_LOGGING_CONFIG
module-attribute
¶
DEFAULT_LOGGING_CONFIG = {
"formatters": {
"vllm": {
"class": "vllm.logging_utils.NewLineFormatter",
"datefmt": _DATE_FORMAT,
"format": _FORMAT,
}
},
"handlers": {
"vllm": {
"class": "logging.StreamHandler",
"formatter": "vllm",
"level": VLLM_LOGGING_LEVEL,
"stream": "ext://sys.stdout",
}
},
"loggers": {
"vllm": {
"handlers": ["vllm"],
"level": "DEBUG",
"propagate": False,
}
},
"version": 1,
"disable_existing_loggers": False,
}
_FORMAT
module-attribute
¶
_FORMAT = f"{VLLM_LOGGING_PREFIX}%(levelname)s %(asctime)s [%(filename)s:%(lineno)d] %(message)s"
_VllmLogger
¶
Bases: Logger
Note
This class is just to provide type information.
We actually patch the methods directly on the logging.Logger
instance to avoid conflicting with other libraries such as
intel_extension_for_pytorch.utils._logger
.
Source code in vllm/logger.py
_configure_vllm_root_logger
¶
Source code in vllm/logger.py
_print_info_once
cached
¶
_print_warning_once
cached
¶
_trace_calls
¶
Source code in vllm/logger.py
enable_trace_function_call
¶
Enable tracing of every function call in code under root_dir
.
This is useful for debugging hangs or crashes.
log_file_path
is the path to the log file.
root_dir
is the root directory of the code to trace. If None, it is the
vllm root directory.
Note that this call is thread-level, any threads calling this function will have the trace enabled. Other threads will not be affected.
Source code in vllm/logger.py
init_logger
¶
init_logger(name: str) -> _VllmLogger
The main purpose of this function is to ensure that loggers are retrieved in such a way that we can be sure the root vllm logger has already been configured.