Skip to content

[Bug]Logging for python 3.13 in local environment #4686

@sun-god-gear

Description

@sun-god-gear

Expected Behavior

Regardless of python version, I would expect custom logs (i.e. using logging library) to be emitted.

Logs should show up in the invocation logs, and in the console when running the function locally using func host start with the core tools.

Actual Behavior

When using the Python 3.13 worker, custom logs are not emitted locally. You only get the function start and complete logs.

When using Python 3.12, custom logs are emitted for the exact same code.

Python 3.13 (not working):
Image

Python 3.12 (working):

Image

The expected debug log appears in the second screenshot.
FYI I have tried this with different runtime versions of the Core tools:

Image

as well as:

Image

Steps to Reproduce

  1. Use Python runtime 3.13 on Azure Function (or create a venv with Python 3.13 locally)
  2. Write a function that includes import logging and gets triggered on a cron schedule
  3. Start the function app
  4. The function gets executed according to the schedule
  5. Observe that no logs are output other than the Executing, received ... and Executed. The log statement itself is missing

Switching to python 3.12 and re-running the steps will show the log statement getting produced

Relevant code being tried

import logging
import azure.functions as func


app = func.FunctionApp()


@app.timer_trigger(schedule="*/15 * * * * *", arg_name="myTimer", run_on_startup=False,
              use_monitor=False) 
def timer_trigger_sharepoint(myTimer: func.TimerRequest) -> None:

    logging.info("Timer trigger function executed at: ")

Relevant log output

requirements.txt file

azure-functions
logging

Where are you facing this problem?

Local - Core Tools

Function app name

No response

Additional Information

@hallvictoria Issue - #1760 was closed for the same/similar issue and #1745 claims to have resolved this issue. But can you confirm if this is indeed fixed and if I am missing anything?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions