-
Notifications
You must be signed in to change notification settings - Fork 408
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
Making SingleFieldAppendingMarker#getFieldValue() package-private broke log assertions #788
Comments
Was |
Hi @elefeint The visibility of As you know, we also have more complex markers like |
The enhancer is an optional add-on that adds Logstash markers as log metadata for logs written to GCP Cloud Logging. So as long as we have a way to extract marker information from logback's |
Does spring-cloud-gcp logging allow appending arbitrary "raw" JSON to their JSON event output? If so, it could:
This approach would support every type of |
spring-cloud-gcp glues together Logback and GCP abilities -- in this case, logback's |
That's unfortunate. The limitations of JsonLayout are one of the reasons logstash-logback-encoder exists ;) The LogstashMarkers weren't really designed to be consumed by anything other than the encoders within logstash-logback-encoder. This issue is the first case I've heard about where LogstashMarkers are being consumed by something other than the encoders within logstash-logback-encoder. As such, the current implementation in spring-cloud-gcp that consumes the markers directly is going to be extremely fragile. Will need to think about this some to come up with a good approach. |
Thank you! For now, we'll hold off on upgrading. |
Fwiw, we also need the actual value and not JSON for our assertions @philsttr, since the whole point of those assertions is that they are based on content and should work regardless of log formatting/encoding. So I would also be happy if there was a way to get to the contents. |
Not an issue for me anymore. I've removed the assertion from my log testing library. |
@waschmittel Thanks for the feedback. |
Yes, but because it's an optional add-on feature, we could remove it in a major release in early 2023. Ultimately, end users can create custom GCP logger enhancers with the data that they use for logstash markers. |
This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further. |
Description
I am maintaining https://github.com/dm-drogeriemarkt/log-capture/ which we use to test our logging.
I also allows to assert logging of keyValue, see https://github.com/dm-drogeriemarkt/log-capture/#key-value-from-logstash
Making
SingleFieldAppendingMarker#getFieldValue()
package-private broke that for me, because I used it for those assertions. I don't see a viable replacement, although I might be overlooking something.Expected behavior
I am aware that is kind of a https://xkcd.com/1172/ situation ;-), but I would like a way to be still able to use those assertions. If everything else fails, I can mis-use toStringSelf() and filter out the key, but I'd rather not do that.
The text was updated successfully, but these errors were encountered: