<@U06RKAMK0UC> I dont see INFO logs being printed ...
# ask-ai
g
@ancient-wolf-19325 I dont see INFO logs being printed when using pyflyte logger
j
To ensure INFO logs are printed when using the Flyte logger, you need to set the logging level appropriately. According to Flyte Community Discussion, you should configure the root logger to the INFO level. Here's how you can do it:
Copy code
import logging

logging.basicConfig(level=logging.INFO)
Additionally, make sure to set the
FLYTE_SDK_LOGGING_LEVEL
environment variable to
20
(which corresponds to INFO level) as mentioned in the GitHub Issue:
Copy code
import os

os.environ["FLYTE_SDK_LOGGING_LEVEL"] = "20"
Would you like more details on configuring logging in Flyte? Sources: - Flyte Community Discussion - GitHub Issue 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.
g
@ancient-wolf-19325 logger.info still isnt printing
j
To ensure that
logger.info
prints correctly, you need to configure the Flyte logger and the root logger properly. According to Flyte Community Discussion, you should set up the logging configuration before using the logger. Here's an example: 1. Set the
FLYTE_SDK_LOGGING_LEVEL
environment variable:
Copy code
import os
os.environ["FLYTE_SDK_LOGGING_LEVEL"] = "20"  # INFO level
2. Configure the root logger:
Copy code
import logging

logging.basicConfig(level=logging.INFO)
3. Use the Flyte logger:
Copy code
from flytekit import logger

logger.info("This is an info message")
If you still face issues, ensure that the logging configuration is set before any logging calls are made. This is crucial as per the Flyte GitHub Issue. Would you like more detailed steps or a code example? Sources: - Flyte Community Discussion - Flyte GitHub Issue 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.