sile / sloggers

A Rust library which provides frequently used slog loggers and convenient functions
MIT License
37 stars 18 forks source link

Implement #7: Timestamp in log file name #15

Closed dvtomas closed 6 years ago

dvtomas commented 6 years ago

Relevant configuration in file.toml:

# ...
timezone = "local" # utc or local

# {timestamp} will be replaced with timestamp in the appropriate time zone
# formatted according to the timestamp_template setting.
path = "file_{timestamp}.log"

# Format string for the timestamp in path.
# The string is formatted using [strftime](https://docs.rs/chrono/0.4.6/chrono/format/strftime/index.html#specifiers)
# Default: "%Y%m%d_%H%M", example: "20180918_1127"
timestamp_template = "%Y%m%d_%H%M"
sile commented 6 years ago

LGTM. Thanks!