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

docd: add slog and JSON logging #149

Merged
merged 1 commit into from
Oct 30, 2023
Merged

docd: add slog and JSON logging #149

merged 1 commit into from
Oct 30, 2023

Conversation

jonathaningram
Copy link
Member

@jonathaningram jonathaningram commented Oct 30, 2023

Remove -log-level flag from docd in favor of callers passing the X-Debug: true header. Example CURL:

curl -F "[email protected]" "http://127.0.0.1:8888/convert?readability=1" -H "X-Debug: true" -H "X-Cloud-Trace-Context: 1234/5678"

Outputs in logs:

{"time":"2023-10-30T05:47:29.208212088Z","severity":"DEBUG","logging.googleapis.com/sourceLocation":{"function":"main.(*convertServer).convert","file":"/app/docd/convert.go","line":31},"message":"Readability is on","logging.googleapis.com/trace":"projects/xxxx/traces/1234","logging.googleapis.com/spanId":"5678"}
{"time":"2023-10-30T05:47:29.208321755Z","severity":"INFO","logging.googleapis.com/sourceLocation":{"function":"main.(*convertServer).convert","file":"/app/docd/convert.go","line":75},"message":"Received file","filename":"test-good.pdf","mimeType":"application/pdf","logging.googleapis.com/trace":"projects/xxxx/traces/1234","logging.googleapis.com/spanId":"5678"}

Change minimum Go version to 1.21.

@jonathaningram jonathaningram merged commit bad7570 into master Oct 30, 2023
1 check passed
@jonathaningram jonathaningram deleted the json-logging branch October 30, 2023 05:53
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.

2 participants