[Feature Request] Logging statements are not present in log output
Describe the bug
When emitting logging statements within a flow in prompt flow, they do not appear in the log output.
How To Reproduce the bug Steps to reproduce the behavior, how frequent can you experience the bug:
- In a Python node, emit a log using:
logger = logging.getLogger(__name__)logger.warn("log statement")
"log statement"should show up in the log output when running a flow
Expected behavior
"log statement" should show up in the log output when running a flow (and with that also in logs.txt).
Running Information(please complete the following information):
- Promptflow Package Version using
1.4.1 - Operating System: WSL on Windows 11
- Python Version using Python (Linux) 3.9.18
Thank you for your feedback. We will fix this issue in the future.
Hi, we're sending this friendly reminder because we haven't heard back from you in 30 days. We need more information about this issue to help address it. Please be sure to give us your input. If we don't hear back from you within 7 days of this comment, the issue will be automatically closed. Thank you!
@thy09 this issue was closed as not planned. I can't reactivate the issue, can you please reopen it?
Hi, we're sending this friendly reminder because we haven't heard back from you in 30 days. We need more information about this issue to help address it. Please be sure to give us your input. If we don't hear back from you within 7 days of this comment, the issue will be automatically closed. Thank you!
Hi @bastbu , after review, this should be considered a feature request. We will consider enabling logging in the tool in the future. Thank you for your feedback.
Is there any temporary solution in place? We are planning to use prompt flow in production and would like to add our own logs. Even setting my own logging configuration like this:
logging.basicConfig(filename="sample.log", level=logging.WARNING") is not even saving my logs to any file.
Is there any solution to this? I can't see print statements either
Following up, even setting the below, I don't see any of my own logging output in the logs:
import logging
os.environ["PF_LOGGING_LEVEL"] = "DEBUG"
logging.basicConfig(level=logging.DEBUG)
logger = logging.getLogger(__name__)
A crappy solution is to just use print to help at least with debugging. Would be very beneficial to get proper custom logging to work, as figuring out what happens inside python tools without this functionality is far from ideal.