googleapis / java-logging-logback

Apache License 2.0
42 stars 29 forks source link

Add possibility to modify the builder payload #754

Closed fp7 closed 10 months ago

fp7 commented 2 years ago

Is your feature request related to a problem? Please describe. In Cloud Tasks every task has a link to the log explorer which executes a query with parameters

jsonPayload.task=....

The task is added in app engine per default, but for gce it needs to be added manually, which can not be done because the JsonPayload is fixed.

Describe the solution you'd like Add an api to add fields to the json payload.

losalex commented 1 year ago

Thanks @fp7 for opening the issue and really sorry it took so much time! I believe that you can achieve what you need by leveraging LoggingEventEnhancer - there is a possibility to modify a payload field to be of JsonPayload. I guess you could also create a class inheriting from ILoggingEvent which could be extended to carry any additional info you need when it is processed by custom LoggingEventEnhancer. Hope it helps - please let me know if such solution can work for you.