headscale icon indicating copy to clipboard operation
headscale copied to clipboard

Toggle JSON logging

Open kazauwa opened this issue 2 years ago • 4 comments

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.

kazauwa avatar Jun 17 '22 20:06 kazauwa

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 avatar Jun 18 '22 12:06 kazauwa

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

iSchluff avatar Aug 18 '22 16:08 iSchluff

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

kazauwa avatar Aug 26 '22 11:08 kazauwa

not a maintainer, just keen on this feature :)

iSchluff avatar Aug 31 '22 10:08 iSchluff

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

juanfont avatar Sep 21 '22 15:09 juanfont