LMCache icon indicating copy to clipboard operation
LMCache copied to clipboard

DEBUG Logs Persist Despite Setting INFO Level in `init_logger`

Open dequeueing opened this issue 1 year ago • 3 comments

Describe the bug DEBUG logs (e.g., "Rebuilt the input!" from vllm_adapter.py:660) keep showing up even after setting INFO level in lmcache/logging.py. Changed basicConfig and init_logger to INFO, but getEffectiveLevel() still reports 10 (DEBUG) for "lmcache_vllm" and "lmcache_vllm.vllm_adapter". Submodule loggers seem to ignore the parent level or get reset.

Are there any other ways to set the logger level?

To Reproduce

  1. Update lmcache/logging.py:
import logging
logging.basicConfig(level=logging.INFO)
def init_logger(name: str) -> logging.Logger:
 logger = logging.getLogger(name)
 logger.setLevel(logging.INFO)
 return logger
  1. Run offline_inference.py
LMCACHE_CONFIG_FILE=example.yaml CUDA_VISIBLE_DEVICES=0 python3 offline_inference.py
  1. Check levels:
print(logging.getLogger("lmcache_vllm").getEffectiveLevel())  # 10
print(logging.getLogger("lmcache_vllm.vllm_adapter").getEffectiveLevel())  # 10
  1. See DEBUG logs like:
DEBUG LMCache: Rebuilt the input! [2025-02-26 ...] -- .../vllm_adapter.py:660

Screenshot

Image

Expected behavior

No DEBUG logs—only INFO and above with basicConfig(level=INFO) and logger.setLevel(logging.INFO).

Desktop lmcache 0.1.4 lmcache_vllm 0.6.2.3

dequeueing avatar Feb 26 '25 11:02 dequeueing

hey @dequeueing Thanks for submitting the issue! Will take a look soon.

cc @YaoJiayi

YuhanLiu11 avatar Feb 28 '25 07:02 YuhanLiu11

This issue has been automatically marked as stale because it has not had activity within 60 days. It will be automatically closed if no further activity occurs within 30 days.

github-actions[bot] avatar Jul 11 '25 03:07 github-actions[bot]

This issue has been automatically closed due to inactivity. Please feel free to reopen if you feel it is still relevant!

github-actions[bot] avatar Aug 11 '25 03:08 github-actions[bot]