ViliusS commented on code in PR #3586:
URL: https://github.com/apache/logging-log4j2/pull/3586#discussion_r2044531747
##########
log4j-layout-template-json/src/main/resources/GcpLayout.json:
##########
@@ -49,25 +55,15 @@
"key": "span_id"
},
"logging.googleapis.com/trace_sampled": true,
- "_exception": {
- "class": {
- "$resolver": "exception",
- "field": "className"
- },
- "message": {
- "$resolver": "exception",
- "field": "message"
- },
- "stackTrace": {
- "$resolver": "pattern",
- "pattern": "%xEx"
- }
+ "exception": {
+ "$resolver": "pattern",
+ "pattern": "%xEx"
},
Review Comment:
It seems that I first tested `exception` resolver without `stringify`
parameter. This was a probable reason why it was not caught by Google Error
Reporting dashboard. I have now re-tested with `stringify` -> `true` and this
is what I've got.
The look with `exception` resolver:

This is how it looks with `%xEx` pattern:

This is the look on Error Reporting page (item 1 and 2 in the list):

If you ask me I would still preferred message + exception format (item 3 in
the screenshot above). At least this is how other libraries and Java software
reports exceptions to Error Reporting. See the comparison:

But to match this, we would need to remove `exception` field completely and
rely only on `message` field, or have the same information duplicated to
`exception` field, which I don't see the point.
Anyway, if you prefer one format or another, I could adjust the patch. Keep
in mind though that current patch doesn't change anything regarding exception
format. Current JSON layout used `%xEx` all along. I just changed field name.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]