googleapis / env-tests-logging

Apache License 2.0
3 stars 6 forks source link

add resource detection to java tests #56

Open daniel-sanche opened 3 years ago

daniel-sanche commented 3 years ago

Right now, java environment tests send logs with a hard-coded global resource. Look into how to use auto-detection on java

minherz commented 3 years ago

I am working on implementing structured logging in java-logging. It will auto-populate resource field in LogEntries both in Veneer and Integration client libraries. I will link the relevant issue to this one for better tracking.

daniel-sanche commented 3 years ago

For this issue, I was specifically making a note to myself to swap out this line, with another that doesn't explicitly set the moniotored resource.

Currently, removing the .setResource() line causes an error. Regardless of structured logging work, there should be a way to log without setting the resource, letting the library populate it automatically. I'm not sure if that needs to be implemented in the library, or if I need to form my log in a different way