eclipse-velocitas / vehicle-app-python-sdk

vehicle-app-python-sdk
Apache License 2.0
7 stars 18 forks source link

[Bug]: Seatadjuster logs everything to stderr #83

Closed mikehaller closed 1 year ago

mikehaller commented 1 year ago

What happened?

Deploying the seatadjuster example and running it in the Kanto container runtime reveals that the log output is actually written to stderr.

I would expect that DEBUG, INFO is logged to stdout by default and only ERROR log statements are logged to stderr.

If this is intentional, maybe a documentation about how to configure the logging would make sense.

Operating System

Linux

What release version or branch did you use?

0.9.0

Relevant log output

root@qemux86-64:~# kanto-cm logs --name seatadjuster-app
{"stream":"stderr","log":"2023-06-06 08:12:29,801 DEBUG [sdv.vehicle_app] [vehicle_app.py:72] [trace_id=7ce3eb42d63c2e79294ba9f45cf50b74 span_id=eb5a71e0ee91a35f resource.service.name=/tmp/staticx-kJGoHg/main] - VehicleApp instantiation successfully done\n","time":"2023-06-06T08:12:29.801430658Z"}
{"stream":"stderr","log":"2023-06-06 08:12:29,801 INFO [sdv.vdb.subscriptions] [subscriptions.py:72] [trace_id=7ce3eb42d63c2e79294ba9f45cf50b74 span_id=eb5a71e0ee91a35f resource.service.name=/tmp/staticx-kJGoHg/main] - Subscribing to SELECT Vehicle.Cabin.Seat.Row1.Pos1.Position\n","time":"2023-06-06T08:12:29.801524843Z"}
{"stream":"stderr","log":"2023-06-06 08:12:29,803 DEBUG [sdv.native.mqtt] [mqtt.py:52] [trace_id=7ce3eb42d63c2e79294ba9f45cf50b74 span_id=eb5a71e0ee91a35f resource.service.name=/tmp/staticx-kJGoHg/main] - Mqtt native connection OK!\n","time":"2023-06-06T08:12:29.803218285Z"}


### Code of Conduct

- [X] I agree to follow this project's rules for contributions
MP91 commented 1 year ago

Hey @mikehaller we are currently discussing this internally and will come back to this once we have a solution.

doosuu commented 1 year ago

Hi @mikehaller we have concluded our discussion and documented the results here: https://eclipse.dev/velocitas/docs/concepts/logging/

tldr: By default we will continue to log everything to stderr. If you need a different behavior for your use-case, please have a look at this SO question: https://stackoverflow.com/questions/1383254/logging-streamhandler-and-standard-streams