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

Improved capture of system logs #110

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Improved capture of system logs #110

wants to merge 2 commits into from

Conversation

asadsa92
Copy link
Contributor

No description provided.

@asadsa92 asadsa92 self-assigned this Nov 15, 2023
@daghf daghf changed the title Improved capture of sytem logs Improved capture of system logs Nov 21, 2023
varnishgather Outdated
capturelog /var/log/dnf.log
capturelog /var/log/user.log

run journalctl -u varnish.service
Copy link
Contributor

Choose a reason for hiding this comment

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

Could perhaps be useful to add a --since=yesterday or similar.

Copy link
Contributor Author

@asadsa92 asadsa92 Nov 21, 2023

Choose a reason for hiding this comment

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

Woulld --since=-1w be better? That's one week of journal.

Copy link

Choose a reason for hiding this comment

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

How about --boot --lines=25000?

That will capture up to 25000 lines since the last time the host was rebooted.
I don't think we'll need more, and it's rarely that many since boot anyways.
If it has a lot of messages, it is usually the same messages over and over and it compresses well.

Varnish log messages seems to be around ~110 characters long, so 25000 lines will cap the log at around 2.75 MB uncompressed.

Copy link
Contributor

Choose a reason for hiding this comment

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

yes to any of these, but it would also be nice to get the first few lines following the boot. If something misfires, it would be nice to see it.

but don't let me derail that discussion. I think the time widow makes a bit more sense that the number of lines, notably if some service is very chatty, but that's not a hard stance.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I agree I would prefer to keep the time window.
I think if the service is too verbose it should be fixed there instead.
It is common for services to have a verbose level, if the user set this level too high then they get more logs :)

Copy link
Contributor

Choose a reason for hiding this comment

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

cool, let's merge?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have updated the PR:

  • Removed capture of compressed logs (I don't think it is needed anymore when we got journal logs). We could maybe also remove the capture of syslog and messages at some point.
  • Capture a few more services.

Please have another look.
Meanwhile, I will have someone test this on a busy server.

Signed-off-by: Asad Sajjad Ahmed <asadsa@varnish-software.com>
Not sure why we have not thought about this...

Signed-off-by: Asad Sajjad Ahmed <asadsa@varnish-software.com>
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.

4 participants