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

google cloud platform format #177

Open
msillence opened this issue May 6, 2022 · 1 comment
Open

google cloud platform format #177

msillence opened this issue May 6, 2022 · 1 comment

Comments

@msillence
Copy link

msillence commented May 6, 2022

It would be great to have a GCP format https://cloud.google.com/logging/docs/structured-logging
Log4j2 has some support the mappings are documented: https://logging.apache.org/log4j/2.x/manual/json-template-layout.html
sepecifically they say:

GcpLayout.json described by Google Cloud Platform structured logging with additional _thread, _logger and _exception fields. The exception trace, if any, is written to the _exception field as well as the message field – the former is useful for explicitly searching/analyzing structured exception information, while the latter is Google’s expected place for the exception, and integrates with Google Error Reporting.

it would be great if this was somewhat compatible a sample message from log4j2 in GcpLayout:

{
    "timestamp": "2022-05-06T15:11:13.059Z",
    "severity": "ERROR",
    "message": "error abc due to:\nabc.def.ghi.MyException: problem specifics.\nMore details ...",
    "logging.googleapis.com/sourceLocation": {
        "function": "abc.def.ghi.MyClass.recordSendError"
    },
    "logging.googleapis.com/insertId": "1261298",
    "_exception": {
        "class": "org.apache.kafka.common.errors.TimeoutException",
        "message": "problem specifics",
        "stackTrace": "MyException: problem specifics.\nMore details ..."
    },
    "_thread": "mythread-1",
    "_logger": "abc.def.ghi.MyClass"
}
@jmini
Copy link

jmini commented Apr 5, 2023

There are two pull requests open for this:

Alternatively this project can be considered: https://github.com/benkard/quarkus-googlecloud-jsonlogging

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants