Avoid configuring root logger in RedisVL#445
Conversation
|
Hi, I’m Jit, a friendly security platform designed to help developers build secure applications from day zero with an MVS (Minimal viable security) mindset. In case there are security findings, they will be communicated to you as a comment inside the PR. Hope you’ll enjoy using Jit. Questions? Comments? Want to learn more? Get in touch with us. |
tylerhutcherson
left a comment
There was a problem hiding this comment.
Makes sense. Any way to test this somehow? The issuer gave a reproducer that we could use to turn into a test case possibly capturing the stdout and comparing
|
@tylerhutcherson Yup! There was an existing test for roughly the same case that I extended to test that we don't emit duplicated logs anymore (it's very similar to the reproducing steps the issuer mentioned - see changes to |
Closes #443
This PR updates the logger configuration helper for RedisVL to avoid configuring the root logger via
logging.basicConfig. That operation was interfering with user-configured loggers, causing app logs to be emitted multiple times and making it trickier to hide RedisVL logs when running in production.In its place, we now configure a
NullHandler(mainly to avoid issues with loggers not having any handlers configured). This means that any RedisVL usage that expects logs to have a specific format must now configure that format for itself.