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

Export rotated logs for vx-logs.log #4152

Closed
carolinemodic opened this issue Nov 1, 2023 · 9 comments
Closed

Export rotated logs for vx-logs.log #4152

carolinemodic opened this issue Nov 1, 2023 · 9 comments
Assignees
Milestone

Comments

@carolinemodic
Copy link
Contributor

@amcmanus can you edit this to specify the details of the names of the files we will need to make sure to export to include all of the compressed versions of the vx-logs file?

@carolinemodic carolinemodic added this to the nh-march milestone Nov 1, 2023
@amcmanus
Copy link
Contributor

amcmanus commented Nov 1, 2023

The logs we will be rotating are:

/var/log/syslog
/var/log/mail.log
/var/log/kern.log
/var/log/auth.log
/var/log/user.log
/var/log/cron.log
/var/log/vx-logs.log

The current log rotation will rotate daily for 365 days. Rotated logs will be gzipped and include a date in the filename, e.g. auth.log-20231101.gz If a machine is powered off, log rotation will take place upon the next boot.

In the vxsuite export from the UI, we will need to start exporting /var/log/vx-logs.log* rather than only /var/log/vx-logs.log.

In the vx-admin export from tty2, we already support this new format since it exports via the wildcard. We only export three log types though:

/var/log/syslog*
/var/log/auth.log*
/var/log/vx-logs.log*

It is unclear to me whether we need to export the full set of standard rsyslog logs (probably don't need mail, for example), but the above list is the complete set available.

@amcmanus
Copy link
Contributor

amcmanus commented Nov 6, 2023

@benadida , logfile name formats that should be exported:

<filename>.log
<filename>.log-<YYYYMMDD>
<filename>.log-<YYYYMMDD>.gz

@amcmanus
Copy link
Contributor

amcmanus commented Nov 7, 2023

@benadida, the location of log files has changed due to permission requirements related to log rotation. All logs are now found in:

/var/log/votingworks/

The naming conventions remain the same, so using auth.log as an example, possible exports could be:

/var/log/votingworks/auth.log
/var/log/votingworks/auth.log-20231107
/var/log/votingworks/auth.log-20231107.gz

@benadida
Copy link
Contributor

Thinking about how we might do this.

Currently, we have a "export logs" and "export CDF logs" as options, and those are optimized for the current log. In particular, if we wanted to export CDF for all the past logs, we'd have to decompress them, convert, and recompress.

I'm thinking that a good first pass at this is just to straight up copy all the files in /var/log/votingworks/* to the USB, with a third button that we'd lable "Export All Logs", and maybe rename the other two to "Export Current Log" and "Export Current CDF Log".

@mattroe what do you think?

@amcmanus
Copy link
Contributor

@benadida , keep in mind log rotation happens on startup now. The current log will now only include logs from the most recent boot, so we'll need to make sure that's clear. If someone wants older logs after a reboot, even if it's just yesterday, they'll need to export more than just the current.

@mattroe
Copy link

mattroe commented Nov 13, 2023

@benadida I think the "Export All Logs" simple copy strategy makes sense. However, given the rotation implementation @amcmanus is referring to, I think the "current" export use case is actually quite limited and we may be able to reduce the options we present on this screen to just exporting all.

We'll still need to make sure we follow up on the complete CDF logs export when we get to wrapping up VVSG logging work.

@benadida
Copy link
Contributor

after live discussion, we're moving to two buttons (same as now) with:

  • save raw --> all files
  • save CDF --> only current one for now, later will upgrade to all

@adghayes
Copy link
Collaborator

@benadida should this be closed?

@benadida
Copy link
Contributor

@benadida should this be closed?

indeed.

closed by #4221

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

No branches or pull requests

5 participants