Skip to content

Improve / simplify logging#523

Merged
djs55 merged 6 commits intomoby:masterfrom
djs55:improve-logging
Apr 17, 2021
Merged

Improve / simplify logging#523
djs55 merged 6 commits intomoby:masterfrom
djs55:improve-logging

Conversation

@djs55
Copy link
Copy Markdown
Collaborator

@djs55 djs55 commented Apr 17, 2021

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 added 6 commits April 17, 2021 14:58
The new format looks like:

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

Signed-off-by: David Scott <dave@recoil.org>
The other logging backends were not used. It's simpler to log to stderr
and allow another program to capture the output (e.g. `docker logs`)

Signed-off-by: David Scott <dave@recoil.org>
In several places we have a `log_exception_continue` function. Since
we can continue, let's not log these as "errors" requiring developer
attention.

Signed-off-by: David Scott <dave@recoil.org>
There are 2 likely failures which we want to distinguish:

1. someone connected and disconnected to check if we are listening
2. a buggy client fails to negotiate the connection

Rather than say
```
Pipe.listen: caught (Failure "Failed to connect vmnet device")
```

We say instead
```
Pipe.listen: rejected ethernet connection: EOF
```

Signed-off-by: David Scott <dave@recoil.org>
Signed-off-by: David Scott <dave@recoil.org>
Log as info instead.

Signed-off-by: David Scott <dave@recoil.org>
@djs55
Copy link
Copy Markdown
Collaborator Author

djs55 commented Apr 17, 2021

CircleCI is green!

@djs55 djs55 merged commit 6123a2f into moby:master Apr 17, 2021
@djs55 djs55 deleted the improve-logging branch April 17, 2021 17:35
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.

1 participant