Skip to content

[Bug] Python 3.13 custom/user logs are not emitted #1760

@adamwhitneysoftwire

Description

@adamwhitneysoftwire

Expected Behavior

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

And therefore should show up in the invocation logs, app insights tables, 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. You only get the function start and complete logs.

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

This behaviour is observed both locally (func host start) and in the deployed Azure Function.

Screenshots of deployed function App Insights

Python 3.13 (not working)

Image

Python 3.12 (working)

Python 3.12 - logs are showing

Note: Expected that debug log won't appear as this is with the default log level.

Screenshots from running locally

Python 3.13 (not working)

Image

Python 3.12 (working)

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 calls logging.debug, logging.info, logging.warn or logging.error
  3. Deploy / start the function app
  4. Execute the function via its trigger
  5. Observe that no logs are output other than the Executing ... and Executed ... info logs

Relevant code being tried

import logging import azure.functions as func app = func.FunctionApp() @app.route( route="demo_logs_missing", methods=["GET"], trigger_arg_name="_req", ) def demo_logs_missing(_req: func.HttpRequest) -> func.HttpResponse: logging.debug("Example debug log") logging.info("Example info log") logging.warning("Example warning") logging.error("Example error log") return func.HttpResponse("OK")

Relevant log output

requirements.txt file

azure-functions

Where are you facing this problem?

Production Environment (explain below)

Function app name

No response

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions