You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importloggingimportsyshandler=logging.StreamHandler(sys.stderr)
handler.setFormatter(
logging.Formatter(
"%(asctime)s %(levelname)s [%(name)s] [%(filename)s:%(lineno)s] %(message)s"
)
)
root_logger=logging.getLogger()
root_logger.handlers= [handler]
root_logger.setLevel(logging.INFO)
my_logger=logging.getLogger("app")
my_logger.info("This is correctly formatted")
fromredisvl.query.filterimportTextmy_logger.info("This is NOT correctly formatted and has been overridden by RedisVL")
Output:
➜ redisvl-issue-log poetry run python redisvl_issue_log/repro.py
2025-02-28 18:18:24,036 INFO [app] [repro.py:16] This is correctly formatted
18:18:24 app INFO This is NOT correctly formatted and has been overridden by RedisVL
This is a very frustrating issue, since it is happening silently at the first RedisVL import. I spent a few hours pinning to this repository. I believe many could have encountered such issues trying to configure general logging, and gave up figuring it out.
Could we disable coloredlogs or at least make sure importing objects outside of CLI does not trigger its installation on the root logger?
Activity
tylerhutcherson commentedon Mar 25, 2025
Thanks for reporting this! We are working on a fix/improvement. Definitely frustrating.
Fix: Prevent RedisVL from overriding logging configurations (#293)
Fix: Prevent RedisVL from overriding logging configurations (#293)
tylerhutcherson commentedon Mar 26, 2025
@duc00 we've merged this into our
0.5.0release branched slated to go out in the next week. Thanks for reporting this!duc00 commentedon Mar 26, 2025
@tylerhutcherson great! Thanks
Fix: Prevent RedisVL from overriding logging configurations (#293)
Fix: Prevent RedisVL from overriding logging configurations (#293)