Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suppress tailscaled logs after 200 lines #138

Merged
merged 3 commits into from
Mar 30, 2023

Conversation

lmagyar
Copy link
Contributor

@lmagyar lmagyar commented Jan 18, 2023

Proposed Changes

Tailscaled is quite chatty and emits a really large amount of log messages.

This PR disables these messages after 200 lines, but makes it possible to re-enable the full logging for troubleshooting.

Based on the idea from tailscale/tailscale-synology#110

Related Issues

--

Copy link
Member

@frenck frenck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tailscaled is quite chatty and emits a really large amount of log messages.

I'm missing: Why is that a concern?

LICENSE.md Outdated Show resolved Hide resolved
Use the built-in `log_level` for tailscaled debug message handling
@frenck frenck added the enhancement Enhancement of the code, not introducing new features. label Mar 28, 2023
@lmagyar
Copy link
Contributor Author

lmagyar commented Mar 28, 2023

Tailscaled is quite chatty and emits a really large amount of log messages.

I'm missing: Why is that a concern?

Tailscaled writes into the log something in nearly each second.

  • This debug noise hides any useful log entry.
  • The logs finally are written to SD card, so I prefer to minimize the wear.

@lmagyar lmagyar force-pushed the disable-tailscaled-debug-messages branch from 23b5e13 to 9fb47b1 Compare March 28, 2023 11:40
@lmagyar
Copy link
Contributor Author

lmagyar commented Mar 30, 2023

I've spent a few hours googling, and found the same discussion in tailscaled-synology: tailscale/tailscale-synology#110

Solution: the logs suppressed after 200 lines, so the startup can be seen in details, but after a few minutes it will stop emitting noise.

I had to modify it a bit due to busybox/sed limitations.

UPDATE

sample log, redacted the most of it:

...
s6-rc: info: service tailscaled successfully started
s6-rc: info: service post-tailscaled: starting
[16:42:33] INFO: Starting Tailscale...
[16:42:33] INFO: Starting Tailscale web...
[16:42:34] NOTICE: Tailscale logs will be suppressed after 200 lines, set add-on's configuration option 'log_level' to 'debug' to see further logs
2023/03/30 16:42:34 web server running on: http://127.0.0.1:25898
2023/03/30 16:42:34 You have disabled logging. Tailscale will not be able to provide support.
2023/03/30 16:42:34 logtail started
2023/03/30 16:42:34 Program starting: v1.38.3-ta972b8565-g55f6b9a5f, Go 1.20.1-tsdb4dc90: []string{"/opt/tailscaled", "--state=/data/tailscaled.state", "--statedir=/data", "--no-logs-no-support", "--tun=userspace-networking"}
2023/03/30 16:42:34 LogID: 42a3b8494218545b4e7ff9c63bb9c6ab214214b37ade177b3f0832dc48b2104e
...
2023/03/30 16:52:49 magicsock: endpoints changed: 172.30.32.1:58177 (local), 172.30.232.1:58177 (local), 192.168.1.9:58177 (local)
2023/03/30 16:53:04 Accept: TCP{[fd7a:115c:a1e0:ab12:4843:cd96:6249:ba61]:51068 > [fd7a:115c:a1e0:ab12:4843:cd96:6269:b357]:37009} 72 tcp non-syn
[further tailscaled logs suppressed, set add-on's configuration option 'log_level' to 'debug' to see further tailscaled logs]

@lmagyar lmagyar changed the title Disable tailscaled debug messages Suppress tailscaled logs after 200 lines Mar 30, 2023
Copy link
Member

@frenck frenck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @lmagyar 👍

../Frenck

@frenck frenck merged commit 0bbafaf into hassio-addons:main Mar 30, 2023
@lmagyar lmagyar deleted the disable-tailscaled-debug-messages branch March 30, 2023 16:27
@github-actions github-actions bot locked and limited conversation to collaborators Apr 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Enhancement of the code, not introducing new features.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants