Skip to content

how to use policy trigger by age, and the log append with {date} #394

@blizzardzheng

Description

@blizzardzheng

i want to use log rolling by date, record 7days, is there any instructions?

expected

rust_file:
    kind: rolling_file
    path: "logs/rust/{date}.log"
    encoder:
      pattern: "{d(%Y-%m-%d %H:%M:%S)} [{l}] {m}{n}"
    policy:
      compound:
        trigger:
          # 按天滚动
          age: 1d
        roller:
          # 保留最近7天的日志
          delete: {}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions