moby / vpnkit

A toolkit for embedding VPN capabilities in your application
Apache License 2.0
1.1k stars 187 forks source link

Improve / simplify logging #523

Closed djs55 closed 3 years ago

djs55 commented 3 years ago

Previously we supported 3 log "destinations":

  1. quiet: stderr
  2. asl: the Apple System Log
  3. eventlog: the Windows event log

This PR removes the asl and eventlog systems to simplify the build dependencies. The eventlog mode was never used anywhere and I'm not sure if it's implemented correctly. The asl mode is being used in Docker Desktop but this isn't a good idea: the system logs are difficult to filter and full of spam. It's much easier to simply log to stderr and rely on another tool to send the logs to the correct destination (e.g. docker logs)

At the same time the output format has been changed to resemble other Go programs for consistency, e.g.:

time="2021-04-17T10:56:51Z" level=info msg="usernet: Increasing preemptive thread pool size to 1024 threads"

Plus a few error logs have been downgraded to info where they are normal e.g. /etc/resolv.conf doesn't exist on Windows; receiving EOF from a disconnecting client is normal.

djs55 commented 3 years ago

CircleCI is green!