Toggle JSON logging #281

Closed
opened 2025-12-29 01:25:53 +01:00 by adam · 5 comments
Owner

Originally created by @kazauwa on GitHub (Jun 17, 2022).

Feature request

Allow to opt-in for JSON logs so they can be easily parsed.
I think the implementation is pretty straightforward, and I can get it done over the weekend.

Originally created by @kazauwa on GitHub (Jun 17, 2022). <!-- Headscale is a multinational community across the globe. Our common language is English. Please consider raising the feature request in this language. --> **Feature request** Allow to opt-in for JSON logs so they can be easily parsed. I think the implementation is pretty straightforward, and I can get it done over the weekend.
adam added the enhancement label 2025-12-29 01:25:53 +01:00
adam closed this issue 2025-12-29 01:25:53 +01:00
Author
Owner

@kazauwa commented on GitHub (Jun 18, 2022):

I suppose the implementation could be something like that:
https://github.com/juanfont/headscale/compare/main...kazauwa:feature/json-logs?expand=1

Setting json_logs to true swtiches to default zerolog formatting:

{"level":"info","path":"/var/lib/headscale/private.key","time":1655553834,"message":"No private key file at path, creating..."}
@kazauwa commented on GitHub (Jun 18, 2022): I suppose the implementation could be something like that: https://github.com/juanfont/headscale/compare/main...kazauwa:feature/json-logs?expand=1 Setting `json_logs` to `true` swtiches to default zerolog formatting: ``` {"level":"info","path":"/var/lib/headscale/private.key","time":1655553834,"message":"No private key file at path, creating..."} ```
Author
Owner

@iSchluff commented on GitHub (Aug 18, 2022):

this seems useful, would you mind creating a pull request?

@iSchluff commented on GitHub (Aug 18, 2022): this seems useful, would you mind creating a pull request?
Author
Owner

@kazauwa commented on GitHub (Aug 26, 2022):

Done
Didn't want to create a PR before hearing from maintainers

@kazauwa commented on GitHub (Aug 26, 2022): Done Didn't want to create a PR before hearing from maintainers
Author
Owner

@iSchluff commented on GitHub (Aug 31, 2022):

not a maintainer, just keen on this feature :)

@iSchluff commented on GitHub (Aug 31, 2022): not a maintainer, just keen on this feature :)
Author
Owner

@juanfont commented on GitHub (Sep 21, 2022):

Merged https://github.com/juanfont/headscale/pull/768

@juanfont commented on GitHub (Sep 21, 2022): Merged https://github.com/juanfont/headscale/pull/768
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#281