zoukankan      html  css  js  c++  java
  • logback 归档日志自动压缩

    需要添加依赖 apache-log4j-extras-X.X.X.jar

    fileNamePattern 以gz或者zip结尾即可

     补充说明:

    新生成归档gz日志文件,服务器上 vim查看和文本文件没有区别

    可以用gzip -l 查看压缩率,确实为压缩文件,grep查不到内容,需要用zgrep

    ftp到window机器上用解压缩软件可以看到是压缩文件

     

    参考资料:http://logging.apache.org/log4j/extras/apidocs/org/apache/log4j/rolling/TimeBasedRollingPolicy.html

    Automatic file compression

    TimeBasedRollingPolicy supports automatic file compression. This feature is enabled if the value of the FileNamePattern option ends with .gz or .zip.

    FileNamePattern valueRollover scheduleExample
    /wombat/foo.%d.gz Daily rollover (at midnight) with automatic GZIP compression of the archived files. During November 23rd, 2004, logging output will go to the file /wombat/foo.2004-11-23. However, at midnight that file will be compressed to become /wombat/foo.2004-11-23.gz. For the 24th of November, logging output will be directed to /wombat/folder/foo.2004-11-24 until its rolled over at the beginning of the next day.

    参考资料:https://blog.csdn.net/rootcn/article/details/30237401

  • 相关阅读:
    LNMP状态管理命令
    Gogs基本使用介绍
    初探Asp.net请求机制原理 1
    关于css定位
    JS不同浏览器图片载入处理
    js之队列01
    javascript 快速排序
    JavaScript prototype背后的工作原理
    关于javascrpt if快速判断说明
    js动态加载图片核心代码
  • 原文地址:https://www.cnblogs.com/leegoo/p/15572872.html
Copyright © 2011-2022 走看看