<@ULVA73B9P> why is my code not logging any info l...
# marvin-in-the-wild
d
@Marvin why is my code not logging any info level logs?
Copy code
import math
from prefect import flow, get_run_logger
from tasks.opportunities import fetch_first_page_opportunities, fetch_opportunities_page, compile_opportunities


@flow
async def opportunity_pipeline():
    """Starts the opportunity pipeline."""
    page_size = 400
    logger = get_run_logger()
    <http://logger.info|logger.info>(f"Starting the opportunity pipeline with a page size of {page_size}")
    total_opportunities, first_page = await fetch_first_page_opportunities(page_size)
    subsequent_pages = []
    for page in range(1, math.ceil(total_opportunities / page_size)):
        opportunities = await fetch_opportunities_page(page, page_size)
        subsequent_pages.append(opportunities)
    raw_opportunities = compile_opportunities(first_page, subsequent_pages)
m
If your code inside a Prefect flow is not logging
INFO
level logs, here are some things you might consider: 1. Ensure that the loggers are properly configured to display logs at the INFO level. By default, Prefect should log at this level, but configurations might differ based on environment variables or Prefect Profile settings. You may need to override these settings (Logs Guide). 2. Check if your logger has been configured in a way that might suppress the INFO logs or if there are any environment-specific issues that may be affecting logging behavior. 3. Verify that there are no unintentional changes to logging configurations in the execution environment that might prevent INFO logs from being displayed. For more detailed troubleshooting, you can reference the Logging Guide from the Prefect documentation to ensure your setup aligns with the expected configurations. In the code snippet you provided, please double-check the logger setup line:
Copy code
python
logger = get_run_logger()
<http://logger.info|logger.info>(f"Starting the opportunity pipeline with a page size of {page_size}")
Make sure there are no typos or syntactic issues with the logger usage. The logger instantiation appears to be correct, but issues can arise from various configurations not explicitly shown in the snippet. For deeper troubleshooting, consulting the Troubleshooting Guide might provide more insights or you might want to search for any related issues on GitHub Issues for similar problems encountered by other users.