Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Reserve the words "Fail" and "Error" in log messages to system level breakage that requires action #10850

Description

@brad2014

Feature description

Minor thing, but I thought I'd mention it:

We rely on the words "fail" and "error" in logs to refer to things that are broken that we need to fix, rather than expected failures of low level actions that the system expects to happen and is designed to recover from.

Log the latter type of failure as an informational message (at most).

For specific example of the general problem, on startup, we see this log message:

Aug 09 07:45:10 hostname syncthing[1344]: Failed to fetch latest release information (error="Get \"https://upgrades.syncthing.net/meta.json\": dial tcp: lookup upgrades.syncthing.net on 127.0.0.53:53: server misbehaving" log.pkg=upgrade)

We expect it to be logged as an informational message (suggested wording):

Aug 09 07:45:10 hostname syncthing[1344]: Unable to fetch latest release information, will retry later (message="Get \"https://upgrades.syncthing.net/meta.json\": dial tcp: lookup upgrades.syncthing.net on 127.0.0.53:53: cannot resolve host name" log.pkg=upgrade)

Of course, if you decide that the startup contract for syncthing is to have working DNS available as a system requirement, then the above failure is indeed an error, in which case definitely have the distributed systemd unit file depend on, and start after, nss-lookup.target.

Problem or use case

The ability to use "fail" and "error" as keywords in the log to identify only problems that require remediation, not informational messages.

Alternatives or workarounds

In our case, addressing this particular example, we do override using /etc/systemd/system/[email protected]/override.conf:

[Unit]
Wants=nss-lookup.target 
After=nss-lookup.target

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew features or improvements of some kind, as opposed to a problem (bug)needs-triageNew issues needed to be validated

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions