mattermost / mattermost-plugin-apps

Powers the Mattermost App Framework
https://developers.mattermost.com/integrate/apps/
Apache License 2.0
34 stars 29 forks source link

Include caller in logs #410

Closed hanzei closed 1 year ago

hanzei commented 1 year ago

Summary

12b7e8878c4bd61c21c7f87f945b9c2ac77b649a add callers to the both the file logger. and the channel logger

Screenshot from 2022-12-07 14-09-10

{"timestamp":"2022-12-07 14:09:06.564 +01:00","level":"debug","msg":"Handled HTTP request","caller":"app/plugin_api.go:970","plugin_id":"com.mattermost.apps","request_id":"t51n6ercg3y78bqshyuj1d559r","path":"/api/v1/bindings","plugin_caller":"server/httpin/service.go:164","from_user_id":"78r48k3iy3b8bxmzfqzsbdnhra"}

11f0b7e5acfd317c475d522f43d4bd04c80df01f ensures that source_plugin_id is only added if it's not empty, which is most of the time. This make the log messages easier to read.

479a20b22f1df7dee74caa6eb7af0f79c0fd9f70 changes a log message to make it more readable.

Ticket Link

Follow up on https://github.com/mattermost/mattermost-plugin-apps/pull/394