Log exceptions as nested array instead of encoded json#8946
Merged
MorrisJobke merged 2 commits intomasterfrom Apr 11, 2018
Merged
Log exceptions as nested array instead of encoded json#8946MorrisJobke merged 2 commits intomasterfrom
MorrisJobke merged 2 commits intomasterfrom
Conversation
Member
|
There was one problem ... I only stated that it is because of the type hinting. I guess what we hand in into the log implementations. But this looks good so far in your version. 🤔 |
Member
Author
|
From what I understood the problem was the old |
MorrisJobke
reviewed
Apr 9, 2018
lib/private/Log.php
Outdated
| 'Message' => $exception->getMessage(), | ||
| 'Code' => $exception->getCode(), | ||
| 'Trace' => $exception->getTraceAsString(), | ||
| 'Trace' => $exception->getTrace(), |
Member
There was a problem hiding this comment.
If this is used passwords are still logged 🙈
{
"reqId": "xaT0UndUeGLdPMu2jnI6",
"level": 3,
"time": "2018-04-09T21:18:30+00:00",
"remoteAddr": "172.20.0.1",
"user": "--",
"app": "index",
"method": "POST",
"url": "/index.php/login",
"message": {
"CustomMessage": "--",
"Exception": "InvalidArgumentException",
"Message": "Username must be string",
"Code": 0,
"Trace": [
{
"file": "/var/www/html/lib/private/AppFramework/Http/Dispatcher.php",
"line": 166,
"function": "tryLogin",
"class": "OC\\Core\\Controller\\LoginController",
"type": "->",
"args": [
"admin",
"password",
null,
false,
"Europe/Berlin",
"2"
]
},
{
"file": "/var/www/html/lib/private/AppFramework/Http/Dispatcher.php",
"line": 99,
"function": "executeController",
"class": "OC\\AppFramework\\Http\\Dispatcher",
"type": "->",
"args": [
{},
"tryLogin"
]
},
{
"file": "/var/www/html/lib/private/AppFramework/App.php",
"line": 118,
"function": "dispatch",
"class": "OC\\AppFramework\\Http\\Dispatcher",
"type": "->",
"args": [
{},
"tryLogin"
]
},
{
"file": "/var/www/html/lib/private/AppFramework/Routing/RouteActionHandler.php",
"line": 47,
"function": "main",
"class": "OC\\AppFramework\\App",
"type": "::",
"args": [
"OC\\Core\\Controller\\LoginController",
"tryLogin",
{},
{
"_route": "core.login.tryLogin"
}
]
},
{
"function": "__invoke",
"class": "OC\\AppFramework\\Routing\\RouteActionHandler",
"type": "->",
"args": [
{
"_route": "core.login.tryLogin"
}
]
},
{
"file": "/var/www/html/lib/private/Route/Router.php",
"line": 297,
"function": "call_user_func",
"args": [
{},
{
"_route": "core.login.tryLogin"
}
]
},
{
"file": "/var/www/html/lib/base.php",
"line": 981,
"function": "match",
"class": "OC\\Route\\Router",
"type": "->",
"args": [
"/login"
]
},
{
"file": "/var/www/html/index.php",
"line": 37,
"function": "handleRequest",
"class": "OC",
"type": "::",
"args": []
}
],
"File": "/var/www/html/core/Controller/LoginController.php",
"Line": 245
},
"userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/604.5.6 (KHTML, like Gecko) Version/11.0.3 Safari/604.5.6",
"version": "14.0.0.1"
}
632c2f2 to
5be0255
Compare
Codecov Report
@@ Coverage Diff @@
## master #8946 +/- ##
============================================
+ Coverage 51.92% 51.94% +0.02%
- Complexity 25313 25344 +31
============================================
Files 1604 1603 -1
Lines 95135 95218 +83
Branches 1388 1387 -1
============================================
+ Hits 49402 49465 +63
- Misses 45733 45753 +20
|
Member
Author
|
@MorrisJobke fixed |
Member
|
Now it removes all parameters: |
5be0255 to
58526d6
Compare
Member
Author
|
missed a strict option 🙈 |
Signed-off-by: Robin Appelman <robin@icewind.nl>
58526d6 to
b9583c6
Compare
Member
|
Unit tests fail 🙈 |
Signed-off-by: Robin Appelman <robin@icewind.nl>
Member
Author
|
ci is happy |
MorrisJobke
approved these changes
Apr 11, 2018
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Revived version of #7826
Logreader support: nextcloud/logreader@0f4be88
I would also like to extend the amount of data we log in a follow up pr (mainly "preview" exception)