owncloud / ocis

:atom_symbol: ownCloud Infinite Scale Stack
https://doc.owncloud.com/ocis/next/
Apache License 2.0
1.42k stars 183 forks source link

feat: improve logs when a context is canceled in the proxy #10601

Closed jvillafanez closed 6 days ago

jvillafanez commented 6 days ago

Description

Improve the logs.

With the PR and a custom logger in the context:

{"level":"error","service":"proxy","remoteAddr":"10.0.2.28","request-id":"","proto":"HTTP/1.1","method":"GET","path":"/js/chunks/List-D8_SE_xL.mjs","query":"","fragment":"","error":"context canceled","time":"2024-11-19T10:07:22Z","message":"error happened in MultiHostReverseProxy"}

With the PR and without logger in the context:

{"level":"error","service":"proxy","error":"context canceled","time":"2024-11-19T09:44:35Z","message":"error happened in MultiHostReverseProxy"}

Without PR:

2024/05/14 06:52:39 http: proxy error: context canceled

Related Issue

No open issue

Motivation and Context

Logs, at the very least, should have the same format

How Has This Been Tested?

Some of the "context canceled" logs happen randomly. However, it common to reproduce it by uploading several images and close the browser tab right after the upload happens, before thumbnails are generated.

Screenshots (if appropriate):

Types of changes

Checklist:

Additional considerations:

update-docs[bot] commented 6 days ago

Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes.

sonarcloud[bot] commented 6 days ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
5.3% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarQube Cloud