Graylog2 / collector-sidecar

Manage log collectors through Graylog
https://www.graylog.org/
Other
268 stars 56 forks source link

Fix directory existence test on Windows #424

Closed thll closed 2 years ago

thll commented 2 years ago

The test if a directory exists is currently broken on Windows. This leads to the sidecar not creating the parent directory for the configured node-id file if the directory doesn't exist yet.

This PR fixes that by using filepath.Dir instead of path.Dir.

Additionally, logging is improved by adding logging for unsuccessful attempts to write to the node-id file.