forked from ask/mode
-
Notifications
You must be signed in to change notification settings - Fork 19
Open
Labels
bugSomething isn't workingSomething isn't workingenhancementNew feature or requestNew feature or requesthelp wantedExtra attention is neededExtra attention is needed
Description
Checklist
- I have included information about relevant versions
- I have verified that the issue persists when using the
masterbranch of Faust.
Steps to reproduce
I'm trying to use structlog inside a Faust app because I want to have JSON output.
However, after Faust initialization, it seems all log messages get prefixed by [date time] [1] [WARNING] .
import faust
import structlog
structlog.configure(processors=[structlog.processors.JSONRenderer()])
logger = structlog.get_logger()
logger.info("structlog configured", message="hello world")
# set up faust
app = faust.app(...)
topic = app.topic(....)
@app.topic(topic)
async def read_topic():
logger.info("Reading from topic", topic=topic)
...Running with `faust -l INFO --app main.app worker
Expected behavior
The first logger.info, on line 6 correctly outputs JSON:
{ "event": "structlog configured", "message": "hello world" }
I expected the second logger.info inside read_topic to also output JSON on a line by itself:
{ "event": "Reading from topic", "topic": "test-topic" },
Actual behavior
Instead all logging after Faust starts get prefixed by what looks to be Faust config override, for example:
[2022-11-08 15:16:17,123] [1] [WARNING] { "event": "Reading from topic", "topic": "test-topic" }
Versions
- Python version: pypy 3.9, python 3.10
- Faust version: 0.9.4
- Operating system: Docker pypy:3.9-7.3.9 image - Linux 5.15.49-linuxkit aarch64 GNU/Linux
- Kafka version: 7.1.1
- RocksDB version (if applicable)
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingenhancementNew feature or requestNew feature or requesthelp wantedExtra attention is neededExtra attention is needed