The Go Programming Language
http://golang.org/
Go Playground
Go Projects
Revel Web Framework
roy2220

filerotate - 高性能日志文件轮转库 (支持时间/大小轮转 + 智能缓存)

  •  
  •   roy2220 · Oct 4, 2025 · 2004 views
    This topic created in 261 days ago, the information mentioned may be changed or developed.

    仓库地址: https://github.com/roy2220/filerotate

    核心特性:

    1. 简单易用:提供标准 io.WriteCloser 接口,零成本接入现有日志系统

    2. 双重轮转机制:同时支持时间轮转和大小轮转,可以灵活组合或单独使用

    3. 智能写缓冲:有效提升写入性能,同时在无写入操作时自动释放缓冲区内存,节省资源

    julyclyde
        1
    julyclyde  
       Oct 5, 2025
    直接 pipe 给 systemd/containerd 不就得了
    何必亲自写文件
    roy2220
        2
    roy2220  
    OP
       Oct 5, 2025
    @julyclyde 主要考虑单机每小时产出 100G+日志的场景。海量日志在交付到远端数据系统之前,最好先持久化到磁盘上,这样做的好处是——当和远端数据系统通信发生故障时,基于文件+offset ,可以很方便地重传、续传日志。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1084 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 23:04 · PVG 07:04 · LAX 16:04 · JFK 19:04
    ♥ Do have faith in what you're doing.