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

Log file naming hardcode the time and extensions separators #64

Open
vche opened this issue Dec 17, 2021 · 0 comments
Open

Log file naming hardcode the time and extensions separators #64

vche opened this issue Dec 17, 2021 · 0 comments
Labels

Comments

@vche
Copy link
Contributor

vche commented Dec 17, 2021

In log file name the separator with the datetime string and the extension strings are hardcoded.

So, using another char than "-" or no extension doesn't work.

file_path = "var/output/logs/fwsyslog.log"
  file_rotation_timeformat = ".%Y-%m-%d-%H-%M"
  file_rotation_time = 60

  # want fwsyslog.2021-12-17-15-06.log
  # get fwsyslog-.2021-12-17-15-39.log
 file_path = "var/output/logs/fwsyslog"
  file_rotation_timeformat = ".%Y-%m-%d-%H-%M"
  file_rotation_time = 60

  # want fwsyslog.2021-12-17-15-06
  # get fwsyslog-.2021-12-17-15-39.log

Update new_file.set_file_name(&format!("{}-{}.{}"

  • The datetime separator must be removed and put in the config string.
  • The ".{}" suffix should only be appended if the filename contains a suffix
@vche vche added the bug label Dec 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant