Skip to content

Update quickstart sample to output correct severity strings#329

Closed
aabmass wants to merge 1 commit intoGoogleCloudPlatform:mainfrom
aabmass:severity
Closed

Update quickstart sample to output correct severity strings#329
aabmass wants to merge 1 commit intoGoogleCloudPlatform:mainfrom
aabmass:severity

Conversation

@aabmass
Copy link
Contributor

@aabmass aabmass commented Apr 17, 2024

Similar to GoogleCloudPlatform/golang-samples#3999, this

  • makes the collector parse severity strings the same way the Cloud Logging agent does
  • outputs the severity levels matching the LogSeverity enum. SLF4J levels are compatible except TRACE and WARN

manually tested by adding log statements and inspecting

{"timestamp":"2024-04-17T17:54:22.598Z","@version":"1","message":"warn - handle /multi request with subRequests=7","logger_name":"com.example.demo.MultiController","thread_name":"reactor-http-epoll-2","logging.googleapis.com/trace":"661e81d941fc0bc07c533136df6edd30","logging.googleapis.com/spanId":"f99ecaa4b31acc1a","logging.googleapis.com/trace_sampled":true,"severity":"WARNING"}
{"timestamp":"2024-04-17T17:54:22.598Z","@version":"1","message":"trace - handle /multi request with subRequests=7","logger_name":"com.example.demo.MultiController","thread_name":"reactor-http-epoll-2","logging.googleapis.com/trace":"661e81d941fc0bc07c533136df6edd30","logging.googleapis.com/spanId":"f99ecaa4b31acc1a","logging.googleapis.com/trace_sampled":true,"severity":"DEBUG"}

@aabmass aabmass requested a review from a team as a code owner April 17, 2024 18:03
@psx95
Copy link
Contributor

psx95 commented Apr 17, 2024

The text "warn" and "trace" in the message field was manually added for debugging only, correct ?

,"message":"warn - handle /multi request with subRequests=7",

@aabmass
Copy link
Contributor Author

aabmass commented Apr 18, 2024

Closing in favor of #330

@aabmass aabmass closed this Apr 18, 2024
@aabmass aabmass deleted the severity branch May 6, 2024 20:07
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

Successfully merging this pull request may close these issues.

3 participants