awslabs / flowgger

A fast data collector in Rust
BSD 2-Clause "Simplified" License
834 stars 55 forks source link

Log file naming hardcode the time and extensions separators #64

Open vche opened 2 years ago

vche commented 2 years ago

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!("{}-{}.{}"