serverless / serverless/serverless

No logger output for Python 3 invoke local

Open
#6,600 1 comment 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug cat/local-dev
Dominant language
JavaScript
Stars
46.9k
Forks
5.7k
Avg merge
10h 7m
Merged PRs (30d)
57

Description

When I run sls invoke local... for my python project I see output when it imports everything and the return value but nothing during the function invocation that is written to logger.

I'm just using log = logging.getLogger(__name__)
and then log.info(), log.error(), etc.
I do see output from print()

I tried adding a logging.basicConfig(level=logging.DEBUG) too but no dice.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue with sls invoke local in a Python project, comparing logging output with print() output during invocation. Trace the local invocation path and confirm the work is done when log.info() and log.error() output appears reliably alongside the function's other output.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.