Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE REQUEST] Logging changes #4151

Closed
12 tasks done
michaelstingl opened this issue Sep 4, 2023 · 5 comments · Fixed by #4204
Closed
12 tasks done

[FEATURE REQUEST] Logging changes #4151

michaelstingl opened this issue Sep 4, 2023 · 5 comments · Fixed by #4204

Comments

@michaelstingl
Copy link
Contributor

michaelstingl commented Sep 4, 2023

Is your feature request related to a problem? Please describe.

I have two problems with logging:

  • (1) debugs logs have only date, but not time: owncloud.2023-09-04.log. Makes it hard to manage multiple logs from the same day
  • (2) HTTP logs have multiple line. this makes it harder to filter
  • (3) Print JSON / XML [body] bigger than 1024 bytes

Describe the solution you'd like

For (1), I'd like to have the the timestamp in the filename:

  • iOS example: ownCloud_Sep_4__2023_at_10_12_02.log.txt
  • desktop example: ownCloud-0904_09.15.05.409.log.gz

For (2), log lines could be combined in a single line with \n

Additional context

Current Android:

D: 2023-09-04 09:57:38:398(LogBuilder.kt:38) .logHttp()[Network, request] [info] [686c8df9-e611-431c-9786-e784b659c1e6] Method: GET URL: https://demo.owncloud.com/.well-known/webfinger?rel=http%3A%2F%2Fopenid.net%2Fspecs%2Fconnect%2F1.0%2Fissuer&resource=https%3A%2F%2Fdemo.owncloud.com
D: 2023-09-04 09:57:38:400(LogBuilder.kt:38) .logHttp()[Network, request] [header] [686c8df9-e611-431c-9786-e784b659c1e6] X-Request-ID: 686c8df9-e611-431c-9786-e784b659c1e6
D: 2023-09-04 09:57:38:402(LogBuilder.kt:38) .logHttp()[Network, request] [header] [686c8df9-e611-431c-9786-e784b659c1e6] User-Agent: Mozilla/5.0 (Android) ownCloud-android/4.1.0-beta.1
D: 2023-09-04 09:57:38:404(LogBuilder.kt:38) .logHttp()[Network, request] [header] [686c8df9-e611-431c-9786-e784b659c1e6] Accept-Language: en
D: 2023-09-04 09:57:38:405(LogBuilder.kt:38) .logHttp()[Network, request] [header] [686c8df9-e611-431c-9786-e784b659c1e6] Accept-Encoding: identity
D: 2023-09-04 09:57:38:408(LogBuilder.kt:38) .logHttp()[Network, request] [header] [686c8df9-e611-431c-9786-e784b659c1e6] Host: demo.owncloud.com
D: 2023-09-04 09:57:38:410(LogBuilder.kt:38) .logHttp()[Network, request] [header] [686c8df9-e611-431c-9786-e784b659c1e6] Connection: Keep-Alive
D: 2023-09-04 09:57:38:412(LogBuilder.kt:38) .logHttp()[Network, request] [body] [686c8df9-e611-431c-9786-e784b659c1e6] Empty body
D: 2023-09-04 09:57:38:537(LogBuilder.kt:38) .logHttp()[Network, response] [info] [686c8df9-e611-431c-9786-e784b659c1e6] Method: GET URL: https://demo.owncloud.com/.well-known/webfinger?rel=http%3A%2F%2Fopenid.net%2Fspecs%2Fconnect%2F1.0%2Fissuer&resource=https%3A%2F%2Fdemo.owncloud.com Code: 302 Message: Found
D: 2023-09-04 09:57:38:538(LogBuilder.kt:38) .logHttp()[Network, response] [header] [686c8df9-e611-431c-9786-e784b659c1e6] Cache-Control: no-store, no-cache, must-revalidate
D: 2023-09-04 09:57:38:538(LogBuilder.kt:38) .logHttp()[Network, response] [header] [686c8df9-e611-431c-9786-e784b659c1e6] Content-Length: 0
D: 2023-09-04 09:57:38:539(LogBuilder.kt:38) .logHttp()[Network, response] [header] [686c8df9-e611-431c-9786-e784b659c1e6] Content-Security-Policy: default-src 'self'; script-src 'self' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; frame-src *; img-src * data: blob:; font-src 'self' data:; media-src *; connect-src *
D: 2023-09-04 09:57:38:540(LogBuilder.kt:38) .logHttp()[Network, response] [header] [686c8df9-e611-431c-9786-e784b659c1e6] Content-Type: text/html; charset=UTF-8
D: 2023-09-04 09:57:38:542(LogBuilder.kt:38) .logHttp()[Network, response] [header] [686c8df9-e611-431c-9786-e784b659c1e6] Date: Mon, 04 Sep 2023 07:57:38 GMT
D: 2023-09-04 09:57:38:543(LogBuilder.kt:38) .logHttp()[Network, response] [header] [686c8df9-e611-431c-9786-e784b659c1e6] Expires: Thu, 19 Nov 1981 08:52:00 GMT
D: 2023-09-04 09:57:38:545(LogBuilder.kt:38) .logHttp()[Network, response] [header] [686c8df9-e611-431c-9786-e784b659c1e6] Location: https://demo.owncloud.com/login
D: 2023-09-04 09:57:38:546(LogBuilder.kt:38) .logHttp()[Network, response] [header] [686c8df9-e611-431c-9786-e784b659c1e6] Pragma: no-cache
D: 2023-09-04 09:57:38:547(LogBuilder.kt:38) .logHttp()[Network, response] [header] [686c8df9-e611-431c-9786-e784b659c1e6] Referrer-Policy: strict-origin-when-cross-origin
D: 2023-09-04 09:57:38:549(LogBuilder.kt:38) .logHttp()[Network, response] [header] [686c8df9-e611-431c-9786-e784b659c1e6] Server: Apache
D: 2023-09-04 09:57:38:550(LogBuilder.kt:38) .logHttp()[Network, response] [header] [686c8df9-e611-431c-9786-e784b659c1e6] Set-Cookie: oc1gfw6ebs4s=48vq2ik1cd29usppeb0fe4ucki; path=/; secure; HttpOnly; SameSite=Lax
D: 2023-09-04 09:57:38:552(LogBuilder.kt:38) .logHttp()[Network, response] [header] [686c8df9-e611-431c-9786-e784b659c1e6] Set-Cookie: oc_sessionPassphrase=iQtL1ofzudcFFxUl3u9hQThCHb%2FTqMJkgjxEdtryFg4G2dlMlX3d1VeMx20353PJFChtnO%2BGHamjDGrWxMhmv%2B3qfTGSAj1XzoeY5LchZpvrTqYly8zDxoDO0oEziW29; expires=Mon, 04-Sep-2023 08:17:38 GMT; Max-Age=1200; path=/; secure; HttpOnly; SameSite=Lax
D: 2023-09-04 09:57:38:554(LogBuilder.kt:38) .logHttp()[Network, response] [header] [686c8df9-e611-431c-9786-e784b659c1e6] Strict-Transport-Security: max-age=315360000; preload
D: 2023-09-04 09:57:38:555(LogBuilder.kt:38) .logHttp()[Network, response] [header] [686c8df9-e611-431c-9786-e784b659c1e6] X-Content-Type-Options: nosniff
D: 2023-09-04 09:57:38:557(LogBuilder.kt:38) .logHttp()[Network, response] [header] [686c8df9-e611-431c-9786-e784b659c1e6] X-Download-Options: noopen
D: 2023-09-04 09:57:38:557(LogBuilder.kt:38) .logHttp()[Network, response] [header] [686c8df9-e611-431c-9786-e784b659c1e6] X-Frame-Options: SAMEORIGIN
D: 2023-09-04 09:57:38:558(LogBuilder.kt:38) .logHttp()[Network, response] [header] [686c8df9-e611-431c-9786-e784b659c1e6] X-Permitted-Cross-Domain-Policies: none
D: 2023-09-04 09:57:38:559(LogBuilder.kt:38) .logHttp()[Network, response] [header] [686c8df9-e611-431c-9786-e784b659c1e6] X-Robots-Tag: none
D: 2023-09-04 09:57:38:560(LogBuilder.kt:38) .logHttp()[Network, response] [header] [686c8df9-e611-431c-9786-e784b659c1e6] X-Xss-Protection: 0
D: 2023-09-04 09:57:38:561(LogBuilder.kt:38) .logHttp()[Network, response] [body] [686c8df9-e611-431c-9786-e784b659c1e6] Length: 0 byte body
D: 2023-09-04 09:57:38:561(LogBuilder.kt:38) .logHttp()[Network, response] [body] [686c8df9-e611-431c-9786-e784b659c1e6] Type: text/html; charset=UTF-8
D: 2023-09-04 09:57:38:562(LogBuilder.kt:38) .logHttp()[Network, response] [body] [686c8df9-e611-431c-9786-e784b659c1e6] --> Body start for response
D: 2023-09-04 09:57:38:563(LogBuilder.kt:38) .logHttp()[Network, response] [body] [686c8df9-e611-431c-9786-e784b659c1e6] 
D: 2023-09-04 09:57:38:564(LogBuilder.kt:38) .logHttp()[Network, response] [body] [686c8df9-e611-431c-9786-e784b659c1e6] <-- Body end for response -- Omitted: 0 bytes

iOS currently looks like this:

2023-09-04 10:18:03.246000+0200 ownCloud[1023:874264] [dbug] | [HTTP, Request, …] Sending request:\n# REQUEST ---------------------------------------------------------\nURL:         https://demo.owncloud.com/status.php\nError:       -\nReq Signals: (null)\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\nGET /status.php HTTP/1.1\nHost: demo.owncloud.com\nX-Request-ID: 9011C47C-043C-4AB6-A0E2-D04B2FDBF369\nOriginal-Request-ID: 9011C47C-043C-4AB6-A0E2-D04B2FDBF369\nCookie: ocaxgc6t8nae=6vmp3jk684lg0uq57tuitggm58; oc_sessionPassphrase=%2BeKNSkHwZOYvE2wTqk3XjoYyT%2FflJHplh2WpXde%2FLtA5GU7rckDYzX7p%2B8%2FsnrKhJaWKTg0Q00t%2B7TsM61FlCAdiBEC2YMdplsx89eN4UnwghDrUK2y7DaEsPoinBe8R\nUser-Agent: ownCloudApp/12.0.3 (App/282; iPadOS/17.0; iPad)\n----------------------------------------------------------------- [… GET, RequestID:9011C47C-043C-4AB6-A0E2-D04B2FDBF369, URLSessionTaskID:27] [OCHTTPPipeline.m:1183|FULL]
2023-09-04 10:18:03.289000+0200 ownCloud[1023:874264] [dbug] | [HTTP, Response, …] Received response:\n# RESPONSE --------------------------------------------------------\nMethod:      GET\nURL:         https://demo.owncloud.com/status.php\nRequest-ID:  9011C47C-043C-4AB6-A0E2-D04B2FDBF369\nError:       -\nReq Signals: (null)\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n200 NO ERROR\nAccess-Control-Allow-Origin: *\nContent-Type: application/json\nPragma: no-cache\ncontent-security-policy: default-src 'self'; script-src 'self' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; frame-src *; img-src * data: blob:; font-src 'self' data:; media-src *; connect-src *\nSet-Cookie: oc_sessionPassphrase=%2BeKNSkHwZOYvE2wTqk3XjoYyT%2FflJHplh2WpXde%2FLtA5GU7rckDYzX7p%2B8%2FsnrKhJaWKTg0Q00t%2B7TsM61FlCAdiBEC2YMdplsx89eN4UnwghDrUK2y7DaEsPoinBe8R; expires=Mon, 04-Sep-2023 08:38:03 GMT; Max-Age=1200; path=/; secure; HttpOnly; SameSite=Lax\nServer: Apache\nx-download-options: noopen\nExpires: Thu, 19 Nov 1981 08:52:00 GMT\nx-xss-protection: 0\nreferrer-policy: strict-origin-when-cross-origin\nx-permitted-cross-domain-policies: none\nCache-Control: no-store, no-cache, must-revalidate\nDate: Mon, 04 Sep 2023 08:18:03 GMT\nx-robots-tag: none\nStrict-Transport-Security: max-age=315360000; preload\nContent-Length: 178\nx-content-type-options: nosniff\nx-frame-options: SAMEORIGIN\n\n{"installed":true,"maintenance":false,"needsDbUpgrade":false,"version":"10.13.0.4","versionstring":"10.13.0","edition":"Enterprise","productname":"ownCloud","product":"ownCloud"}\n----------------------------------------------------------------- [… GET, RequestID:9011C47C-043C-4AB6-A0E2-D04B2FDBF369, URLSessionTaskID:27] [OCHTTPPipeline.m:1306|FULL]

It can be very easily expanded like this:

2023-09-04 10:18:03.246000+0200 ownCloud[1023:874264] [dbug] | [HTTP, Request, …] Sending request:
# REQUEST ---------------------------------------------------------
URL:         https://demo.owncloud.com/status.php
Error:       -
Req Signals: (null)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
GET /status.php HTTP/1.1
Host: demo.owncloud.com
X-Request-ID: 9011C47C-043C-4AB6-A0E2-D04B2FDBF369
Original-Request-ID: 9011C47C-043C-4AB6-A0E2-D04B2FDBF369
Cookie: ocaxgc6t8nae=6vmp3jk684lg0uq57tuitggm58; oc_sessionPassphrase=%2BeKNSkHwZOYvE2wTqk3XjoYyT%2FflJHplh2WpXde%2FLtA5GU7rckDYzX7p%2B8%2FsnrKhJaWKTg0Q00t%2B7TsM61FlCAdiBEC2YMdplsx89eN4UnwghDrUK2y7DaEsPoinBe8R
User-Agent: ownCloudApp/12.0.3 (App/282; iPadOS/17.0; iPad)
----------------------------------------------------------------- [… GET, RequestID:9011C47C-043C-4AB6-A0E2-D04B2FDBF369, URLSessionTaskID:27] [OCHTTPPipeline.m:1183|FULL]
2023-09-04 10:18:03.289000+0200 ownCloud[1023:874264] [dbug] | [HTTP, Response, …] Received response:
# RESPONSE --------------------------------------------------------
Method:      GET
URL:         https://demo.owncloud.com/status.php
Request-ID:  9011C47C-043C-4AB6-A0E2-D04B2FDBF369
Error:       -
Req Signals: (null)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
200 NO ERROR
Access-Control-Allow-Origin: *
Content-Type: application/json
Pragma: no-cache
content-security-policy: default-src 'self'; script-src 'self' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; frame-src *; img-src * data: blob:; font-src 'self' data:; media-src *; connect-src *
Set-Cookie: oc_sessionPassphrase=%2BeKNSkHwZOYvE2wTqk3XjoYyT%2FflJHplh2WpXde%2FLtA5GU7rckDYzX7p%2B8%2FsnrKhJaWKTg0Q00t%2B7TsM61FlCAdiBEC2YMdplsx89eN4UnwghDrUK2y7DaEsPoinBe8R; expires=Mon, 04-Sep-2023 08:38:03 GMT; Max-Age=1200; path=/; secure; HttpOnly; SameSite=Lax
Server: Apache
x-download-options: noopen
Expires: Thu, 19 Nov 1981 08:52:00 GMT
x-xss-protection: 0
referrer-policy: strict-origin-when-cross-origin
x-permitted-cross-domain-policies: none
Cache-Control: no-store, no-cache, must-revalidate
Date: Mon, 04 Sep 2023 08:18:03 GMT
x-robots-tag: none
Strict-Transport-Security: max-age=315360000; preload
Content-Length: 178
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN

{"installed":true,"maintenance":false,"needsDbUpgrade":false,"version":"10.13.0.4","versionstring":"10.13.0","edition":"Enterprise","productname":"ownCloud","product":"ownCloud"}
----------------------------------------------------------------- [… GET, RequestID:9011C47C-043C-4AB6-A0E2-D04B2FDBF369, URLSessionTaskID:27] [OCHTTPPipeline.m:1306|FULL]

Current desktop is single-line too:

23-09-04 10:22:35:924 [ info sync.httplogger ]:	"deeab329-1c7d-4808-88b5-cdd06a5806b5: Request: GET https://demo.owncloud.com/status.php Header: { User-Agent: Mozilla/5.0 (Macintosh) mirall/5.0.0.12001-daily20230901 (testpilotcloud, macos-23.0.0 ClientArchitecture: arm64 OsArchitecture: arm64), Accept: */*, Accept-Language: en_DE, X-Request-ID: deeab329-1c7d-4808-88b5-cdd06a5806b5, Original-Request-ID: deeab329-1c7d-4808-88b5-cdd06a5806b5, Cookie: ocaxgc6t8nae=jeecn1fkra7788a2ickuk38t1l; oc_sessionPassphrase=inBRnxFProZdCLbVK%2F15nI9%2Bf2suRY8x8EgOkBuFm3Ez0JYKd1ntw7vqYeyHk4yUzNDmp%2BUohFRIYfCiEneIOylk0DhBjgQrh3dON6YpAXzZ51LNB8hDAxHSnk7SI%2F4%2F, } Data: []"

23-09-04 10:22:36:020 [ info sync.httplogger ]:	"deeab329-1c7d-4808-88b5-cdd06a5806b5: Response: GET 200 (95ms) https://demo.owncloud.com/status.php Header: { Access-Control-Allow-Origin: *, Cache-Control: no-store, no-cache, must-revalidate, Content-Length: 178, Content-Security-Policy: default-src 'self'; script-src 'self' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; frame-src *; img-src * data: blob:; font-src 'self' data:; media-src *; connect-src *, Content-Type: application/json, Date: Mon, 04 Sep 2023 08:22:35 GMT, Expires: Thu, 19 Nov 1981 08:52:00 GMT, Pragma: no-cache, Referrer-Policy: strict-origin-when-cross-origin, Server: Apache, Set-Cookie: oc_sessionPassphrase=inBRnxFProZdCLbVK%2F15nI9%2Bf2suRY8x8EgOkBuFm3Ez0JYKd1ntw7vqYeyHk4yUzNDmp%2BUohFRIYfCiEneIOylk0DhBjgQrh3dON6YpAXzZ51LNB8hDAxHSnk7SI%2F4%2F; expires=Mon, 04-Sep-2023 08:42:35 GMT; Max-Age=1200; path=/; secure; HttpOnly; SameSite=Lax, Strict-Transport-Security: max-age=315360000; preload, X-Content-Type-Options: nosniff, X-Download-Options: noopen, X-Frame-Options: SAMEORIGIN, X-Permitted-Cross-Domain-Policies: none, X-Robots-Tag: none, X-Xss-Protection: 0, } Data: [{\"installed\":true,\"maintenance\":false,\"needsDbUpgrade\":false,\"version\":\"10.13.0.4\",\"versionstring\":\"10.13.0\",\"edition\":\"Enterprise\",\"productname\":\"ownCloud\",\"product\":\"ownCloud\"}]"

(they discuss a JSON format)

TASKS

  • Research (if needed)
  • Create branch feature/loggin_changes
  • Development tasks
    • Implement whatever
    • ...
  • Code review and apply changes requested
  • Design test plan
  • QA
  • Merge branch feature/loggin_changes into master
@jesmrec jesmrec added this to the 4.2 - Future milestone Sep 6, 2023
@jesmrec jesmrec added Sprint and removed Sprint labels Sep 14, 2023
@michaelstingl
Copy link
Contributor Author

(1) debugs logs have only date, but not time: owncloud.2023-09-04.log. Makes it hard to manage multiple logs from the same day

Describe the solution you'd like

I'd like to have the the timestamp in the filename:

  • iOS example: ownCloud_Sep_4__2023_at_10_12_02.log.txt
  • desktop example: ownCloud-0904_09.15.05.409.log.gz

@michaelstingl
Copy link
Contributor Author

(2) HTTP logs have multiple line. this makes it harder to filter

Describe the solution you'd like

For (2), log lines could be combined in a single line with \n

Additional context

Current Android:

D: 2023-09-04 09:57:38:398(LogBuilder.kt:38) .logHttp()[Network, request] [info] [686c8df9-e611-431c-9786-e784b659c1e6] Method: GET URL: https://demo.owncloud.com/.well-known/webfinger?rel=http%3A%2F%2Fopenid.net%2Fspecs%2Fconnect%2F1.0%2Fissuer&resource=https%3A%2F%2Fdemo.owncloud.com
D: 2023-09-04 09:57:38:400(LogBuilder.kt:38) .logHttp()[Network, request] [header] [686c8df9-e611-431c-9786-e784b659c1e6] X-Request-ID: 686c8df9-e611-431c-9786-e784b659c1e6
D: 2023-09-04 09:57:38:402(LogBuilder.kt:38) .logHttp()[Network, request] [header] [686c8df9-e611-431c-9786-e784b659c1e6] User-Agent: Mozilla/5.0 (Android) ownCloud-android/4.1.0-beta.1
D: 2023-09-04 09:57:38:404(LogBuilder.kt:38) .logHttp()[Network, request] [header] [686c8df9-e611-431c-9786-e784b659c1e6] Accept-Language: en
D: 2023-09-04 09:57:38:405(LogBuilder.kt:38) .logHttp()[Network, request] [header] [686c8df9-e611-431c-9786-e784b659c1e6] Accept-Encoding: identity
D: 2023-09-04 09:57:38:408(LogBuilder.kt:38) .logHttp()[Network, request] [header] [686c8df9-e611-431c-9786-e784b659c1e6] Host: demo.owncloud.com
D: 2023-09-04 09:57:38:410(LogBuilder.kt:38) .logHttp()[Network, request] [header] [686c8df9-e611-431c-9786-e784b659c1e6] Connection: Keep-Alive
D: 2023-09-04 09:57:38:412(LogBuilder.kt:38) .logHttp()[Network, request] [body] [686c8df9-e611-431c-9786-e784b659c1e6] Empty body
D: 2023-09-04 09:57:38:537(LogBuilder.kt:38) .logHttp()[Network, response] [info] [686c8df9-e611-431c-9786-e784b659c1e6] Method: GET URL: https://demo.owncloud.com/.well-known/webfinger?rel=http%3A%2F%2Fopenid.net%2Fspecs%2Fconnect%2F1.0%2Fissuer&resource=https%3A%2F%2Fdemo.owncloud.com Code: 302 Message: Found
D: 2023-09-04 09:57:38:538(LogBuilder.kt:38) .logHttp()[Network, response] [header] [686c8df9-e611-431c-9786-e784b659c1e6] Cache-Control: no-store, no-cache, must-revalidate
D: 2023-09-04 09:57:38:538(LogBuilder.kt:38) .logHttp()[Network, response] [header] [686c8df9-e611-431c-9786-e784b659c1e6] Content-Length: 0
D: 2023-09-04 09:57:38:539(LogBuilder.kt:38) .logHttp()[Network, response] [header] [686c8df9-e611-431c-9786-e784b659c1e6] Content-Security-Policy: default-src 'self'; script-src 'self' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; frame-src *; img-src * data: blob:; font-src 'self' data:; media-src *; connect-src *
D: 2023-09-04 09:57:38:540(LogBuilder.kt:38) .logHttp()[Network, response] [header] [686c8df9-e611-431c-9786-e784b659c1e6] Content-Type: text/html; charset=UTF-8
D: 2023-09-04 09:57:38:542(LogBuilder.kt:38) .logHttp()[Network, response] [header] [686c8df9-e611-431c-9786-e784b659c1e6] Date: Mon, 04 Sep 2023 07:57:38 GMT
D: 2023-09-04 09:57:38:543(LogBuilder.kt:38) .logHttp()[Network, response] [header] [686c8df9-e611-431c-9786-e784b659c1e6] Expires: Thu, 19 Nov 1981 08:52:00 GMT
D: 2023-09-04 09:57:38:545(LogBuilder.kt:38) .logHttp()[Network, response] [header] [686c8df9-e611-431c-9786-e784b659c1e6] Location: https://demo.owncloud.com/login
D: 2023-09-04 09:57:38:546(LogBuilder.kt:38) .logHttp()[Network, response] [header] [686c8df9-e611-431c-9786-e784b659c1e6] Pragma: no-cache
D: 2023-09-04 09:57:38:547(LogBuilder.kt:38) .logHttp()[Network, response] [header] [686c8df9-e611-431c-9786-e784b659c1e6] Referrer-Policy: strict-origin-when-cross-origin
D: 2023-09-04 09:57:38:549(LogBuilder.kt:38) .logHttp()[Network, response] [header] [686c8df9-e611-431c-9786-e784b659c1e6] Server: Apache
D: 2023-09-04 09:57:38:550(LogBuilder.kt:38) .logHttp()[Network, response] [header] [686c8df9-e611-431c-9786-e784b659c1e6] Set-Cookie: oc1gfw6ebs4s=48vq2ik1cd29usppeb0fe4ucki; path=/; secure; HttpOnly; SameSite=Lax
D: 2023-09-04 09:57:38:552(LogBuilder.kt:38) .logHttp()[Network, response] [header] [686c8df9-e611-431c-9786-e784b659c1e6] Set-Cookie: oc_sessionPassphrase=iQtL1ofzudcFFxUl3u9hQThCHb%2FTqMJkgjxEdtryFg4G2dlMlX3d1VeMx20353PJFChtnO%2BGHamjDGrWxMhmv%2B3qfTGSAj1XzoeY5LchZpvrTqYly8zDxoDO0oEziW29; expires=Mon, 04-Sep-2023 08:17:38 GMT; Max-Age=1200; path=/; secure; HttpOnly; SameSite=Lax
D: 2023-09-04 09:57:38:554(LogBuilder.kt:38) .logHttp()[Network, response] [header] [686c8df9-e611-431c-9786-e784b659c1e6] Strict-Transport-Security: max-age=315360000; preload
D: 2023-09-04 09:57:38:555(LogBuilder.kt:38) .logHttp()[Network, response] [header] [686c8df9-e611-431c-9786-e784b659c1e6] X-Content-Type-Options: nosniff
D: 2023-09-04 09:57:38:557(LogBuilder.kt:38) .logHttp()[Network, response] [header] [686c8df9-e611-431c-9786-e784b659c1e6] X-Download-Options: noopen
D: 2023-09-04 09:57:38:557(LogBuilder.kt:38) .logHttp()[Network, response] [header] [686c8df9-e611-431c-9786-e784b659c1e6] X-Frame-Options: SAMEORIGIN
D: 2023-09-04 09:57:38:558(LogBuilder.kt:38) .logHttp()[Network, response] [header] [686c8df9-e611-431c-9786-e784b659c1e6] X-Permitted-Cross-Domain-Policies: none
D: 2023-09-04 09:57:38:559(LogBuilder.kt:38) .logHttp()[Network, response] [header] [686c8df9-e611-431c-9786-e784b659c1e6] X-Robots-Tag: none
D: 2023-09-04 09:57:38:560(LogBuilder.kt:38) .logHttp()[Network, response] [header] [686c8df9-e611-431c-9786-e784b659c1e6] X-Xss-Protection: 0
D: 2023-09-04 09:57:38:561(LogBuilder.kt:38) .logHttp()[Network, response] [body] [686c8df9-e611-431c-9786-e784b659c1e6] Length: 0 byte body
D: 2023-09-04 09:57:38:561(LogBuilder.kt:38) .logHttp()[Network, response] [body] [686c8df9-e611-431c-9786-e784b659c1e6] Type: text/html; charset=UTF-8
D: 2023-09-04 09:57:38:562(LogBuilder.kt:38) .logHttp()[Network, response] [body] [686c8df9-e611-431c-9786-e784b659c1e6] --> Body start for response
D: 2023-09-04 09:57:38:563(LogBuilder.kt:38) .logHttp()[Network, response] [body] [686c8df9-e611-431c-9786-e784b659c1e6] 
D: 2023-09-04 09:57:38:564(LogBuilder.kt:38) .logHttp()[Network, response] [body] [686c8df9-e611-431c-9786-e784b659c1e6] <-- Body end for response -- Omitted: 0 bytes

iOS currently looks like this:

2023-09-04 10:18:03.246000+0200 ownCloud[1023:874264] [dbug] | [HTTP, Request, …] Sending request:\n# REQUEST ---------------------------------------------------------\nURL:         https://demo.owncloud.com/status.php\nError:       -\nReq Signals: (null)\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\nGET /status.php HTTP/1.1\nHost: demo.owncloud.com\nX-Request-ID: 9011C47C-043C-4AB6-A0E2-D04B2FDBF369\nOriginal-Request-ID: 9011C47C-043C-4AB6-A0E2-D04B2FDBF369\nCookie: ocaxgc6t8nae=6vmp3jk684lg0uq57tuitggm58; oc_sessionPassphrase=%2BeKNSkHwZOYvE2wTqk3XjoYyT%2FflJHplh2WpXde%2FLtA5GU7rckDYzX7p%2B8%2FsnrKhJaWKTg0Q00t%2B7TsM61FlCAdiBEC2YMdplsx89eN4UnwghDrUK2y7DaEsPoinBe8R\nUser-Agent: ownCloudApp/12.0.3 (App/282; iPadOS/17.0; iPad)\n----------------------------------------------------------------- [… GET, RequestID:9011C47C-043C-4AB6-A0E2-D04B2FDBF369, URLSessionTaskID:27] [OCHTTPPipeline.m:1183|FULL]
2023-09-04 10:18:03.289000+0200 ownCloud[1023:874264] [dbug] | [HTTP, Response, …] Received response:\n# RESPONSE --------------------------------------------------------\nMethod:      GET\nURL:         https://demo.owncloud.com/status.php\nRequest-ID:  9011C47C-043C-4AB6-A0E2-D04B2FDBF369\nError:       -\nReq Signals: (null)\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n200 NO ERROR\nAccess-Control-Allow-Origin: *\nContent-Type: application/json\nPragma: no-cache\ncontent-security-policy: default-src 'self'; script-src 'self' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; frame-src *; img-src * data: blob:; font-src 'self' data:; media-src *; connect-src *\nSet-Cookie: oc_sessionPassphrase=%2BeKNSkHwZOYvE2wTqk3XjoYyT%2FflJHplh2WpXde%2FLtA5GU7rckDYzX7p%2B8%2FsnrKhJaWKTg0Q00t%2B7TsM61FlCAdiBEC2YMdplsx89eN4UnwghDrUK2y7DaEsPoinBe8R; expires=Mon, 04-Sep-2023 08:38:03 GMT; Max-Age=1200; path=/; secure; HttpOnly; SameSite=Lax\nServer: Apache\nx-download-options: noopen\nExpires: Thu, 19 Nov 1981 08:52:00 GMT\nx-xss-protection: 0\nreferrer-policy: strict-origin-when-cross-origin\nx-permitted-cross-domain-policies: none\nCache-Control: no-store, no-cache, must-revalidate\nDate: Mon, 04 Sep 2023 08:18:03 GMT\nx-robots-tag: none\nStrict-Transport-Security: max-age=315360000; preload\nContent-Length: 178\nx-content-type-options: nosniff\nx-frame-options: SAMEORIGIN\n\n{"installed":true,"maintenance":false,"needsDbUpgrade":false,"version":"10.13.0.4","versionstring":"10.13.0","edition":"Enterprise","productname":"ownCloud","product":"ownCloud"}\n----------------------------------------------------------------- [… GET, RequestID:9011C47C-043C-4AB6-A0E2-D04B2FDBF369, URLSessionTaskID:27] [OCHTTPPipeline.m:1306|FULL]

It can be very easily expanded like this:

2023-09-04 10:18:03.246000+0200 ownCloud[1023:874264] [dbug] | [HTTP, Request, …] Sending request:
# REQUEST ---------------------------------------------------------
URL:         https://demo.owncloud.com/status.php
Error:       -
Req Signals: (null)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
GET /status.php HTTP/1.1
Host: demo.owncloud.com
X-Request-ID: 9011C47C-043C-4AB6-A0E2-D04B2FDBF369
Original-Request-ID: 9011C47C-043C-4AB6-A0E2-D04B2FDBF369
Cookie: ocaxgc6t8nae=6vmp3jk684lg0uq57tuitggm58; oc_sessionPassphrase=%2BeKNSkHwZOYvE2wTqk3XjoYyT%2FflJHplh2WpXde%2FLtA5GU7rckDYzX7p%2B8%2FsnrKhJaWKTg0Q00t%2B7TsM61FlCAdiBEC2YMdplsx89eN4UnwghDrUK2y7DaEsPoinBe8R
User-Agent: ownCloudApp/12.0.3 (App/282; iPadOS/17.0; iPad)
----------------------------------------------------------------- [… GET, RequestID:9011C47C-043C-4AB6-A0E2-D04B2FDBF369, URLSessionTaskID:27] [OCHTTPPipeline.m:1183|FULL]
2023-09-04 10:18:03.289000+0200 ownCloud[1023:874264] [dbug] | [HTTP, Response, …] Received response:
# RESPONSE --------------------------------------------------------
Method:      GET
URL:         https://demo.owncloud.com/status.php
Request-ID:  9011C47C-043C-4AB6-A0E2-D04B2FDBF369
Error:       -
Req Signals: (null)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
200 NO ERROR
Access-Control-Allow-Origin: *
Content-Type: application/json
Pragma: no-cache
content-security-policy: default-src 'self'; script-src 'self' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; frame-src *; img-src * data: blob:; font-src 'self' data:; media-src *; connect-src *
Set-Cookie: oc_sessionPassphrase=%2BeKNSkHwZOYvE2wTqk3XjoYyT%2FflJHplh2WpXde%2FLtA5GU7rckDYzX7p%2B8%2FsnrKhJaWKTg0Q00t%2B7TsM61FlCAdiBEC2YMdplsx89eN4UnwghDrUK2y7DaEsPoinBe8R; expires=Mon, 04-Sep-2023 08:38:03 GMT; Max-Age=1200; path=/; secure; HttpOnly; SameSite=Lax
Server: Apache
x-download-options: noopen
Expires: Thu, 19 Nov 1981 08:52:00 GMT
x-xss-protection: 0
referrer-policy: strict-origin-when-cross-origin
x-permitted-cross-domain-policies: none
Cache-Control: no-store, no-cache, must-revalidate
Date: Mon, 04 Sep 2023 08:18:03 GMT
x-robots-tag: none
Strict-Transport-Security: max-age=315360000; preload
Content-Length: 178
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN

{"installed":true,"maintenance":false,"needsDbUpgrade":false,"version":"10.13.0.4","versionstring":"10.13.0","edition":"Enterprise","productname":"ownCloud","product":"ownCloud"}
----------------------------------------------------------------- [… GET, RequestID:9011C47C-043C-4AB6-A0E2-D04B2FDBF369, URLSessionTaskID:27] [OCHTTPPipeline.m:1306|FULL]

Current desktop is single-line too:

23-09-04 10:22:35:924 [ info sync.httplogger ]:	"deeab329-1c7d-4808-88b5-cdd06a5806b5: Request: GET https://demo.owncloud.com/status.php Header: { User-Agent: Mozilla/5.0 (Macintosh) mirall/5.0.0.12001-daily20230901 (testpilotcloud, macos-23.0.0 ClientArchitecture: arm64 OsArchitecture: arm64), Accept: */*, Accept-Language: en_DE, X-Request-ID: deeab329-1c7d-4808-88b5-cdd06a5806b5, Original-Request-ID: deeab329-1c7d-4808-88b5-cdd06a5806b5, Cookie: ocaxgc6t8nae=jeecn1fkra7788a2ickuk38t1l; oc_sessionPassphrase=inBRnxFProZdCLbVK%2F15nI9%2Bf2suRY8x8EgOkBuFm3Ez0JYKd1ntw7vqYeyHk4yUzNDmp%2BUohFRIYfCiEneIOylk0DhBjgQrh3dON6YpAXzZ51LNB8hDAxHSnk7SI%2F4%2F, } Data: []"

23-09-04 10:22:36:020 [ info sync.httplogger ]:	"deeab329-1c7d-4808-88b5-cdd06a5806b5: Response: GET 200 (95ms) https://demo.owncloud.com/status.php Header: { Access-Control-Allow-Origin: *, Cache-Control: no-store, no-cache, must-revalidate, Content-Length: 178, Content-Security-Policy: default-src 'self'; script-src 'self' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; frame-src *; img-src * data: blob:; font-src 'self' data:; media-src *; connect-src *, Content-Type: application/json, Date: Mon, 04 Sep 2023 08:22:35 GMT, Expires: Thu, 19 Nov 1981 08:52:00 GMT, Pragma: no-cache, Referrer-Policy: strict-origin-when-cross-origin, Server: Apache, Set-Cookie: oc_sessionPassphrase=inBRnxFProZdCLbVK%2F15nI9%2Bf2suRY8x8EgOkBuFm3Ez0JYKd1ntw7vqYeyHk4yUzNDmp%2BUohFRIYfCiEneIOylk0DhBjgQrh3dON6YpAXzZ51LNB8hDAxHSnk7SI%2F4%2F; expires=Mon, 04-Sep-2023 08:42:35 GMT; Max-Age=1200; path=/; secure; HttpOnly; SameSite=Lax, Strict-Transport-Security: max-age=315360000; preload, X-Content-Type-Options: nosniff, X-Download-Options: noopen, X-Frame-Options: SAMEORIGIN, X-Permitted-Cross-Domain-Policies: none, X-Robots-Tag: none, X-Xss-Protection: 0, } Data: [{\"installed\":true,\"maintenance\":false,\"needsDbUpgrade\":false,\"version\":\"10.13.0.4\",\"versionstring\":\"10.13.0\",\"edition\":\"Enterprise\",\"productname\":\"ownCloud\",\"product\":\"ownCloud\"}]"

(they discuss a JSON format)

@michaelstingl
Copy link
Contributor Author

(3) Print JSON / XML [body] bigger than 1024 bytes

Currently JSON / XML [body] is cut after 1024 bytes. Please align new size with desktop + iOS teams

@jesmrec
Copy link
Collaborator

jesmrec commented Sep 21, 2023

It'd be interesting to unify behaviour across the clients. It may help other teams and also ourselves to handle logs' info.

  • Unify log file names?, as commented above
  • Should we all add JSON format to the logs? whole log in JSON with an specific agreed format in objects/fields or only for http requests/responses? adopted for all clients?
  • Unify line headers?:
    • iOS line header: 2023-09-21 08:53:13.369000+0200 ownCloud[324.004734] [dbug]
    • Android line header: D: 2023-09-04 09:57:38:398(LogBuilder.kt:38)
    • Desktop line header: 23-09-21 10:07:04:699 [ debug default ]

more ideas? CC @TheOneRing @felix-schwarz

@michaelstingl
Copy link
Contributor Author

1st example log uploaded:

@manuelplazaspalacio manuelplazaspalacio linked a pull request Oct 31, 2023 that will close this issue
3 tasks
@michaelstingl michaelstingl added the p3-medium Normal priority label Nov 23, 2023
@jesmrec jesmrec removed the Sprint label Dec 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants