zoukankan      html  css  js  c++  java
  • ES Log4J配置信息

    # 配置RollingFileappender
    appender.rolling.type = RollingFile 
    appender.rolling.name = rolling
    # 日志名称 /var/log/elasticsearch/production.log
    appender.rolling.fileName = ${sys:es.logs.base_path}${sys:file.separator}${sys:es.logs.cluster_name}.log 
    appender.rolling.layout.type = PatternLayout
    appender.rolling.layout.pattern = [%d{ISO8601}][%-5p][%-25c{1.}] %marker%.-10000m%n
    # 滚动日志到/var/log/elasticsearch/production-yyyy-MM-dd-i.log; 日志将被压缩在每个滚动,i并将增加
    appender.rolling.filePattern = ${sys:es.logs.base_path}${sys:file.separator}${sys:es.logs.cluster_name}-%d{yyyy-MM-dd}-%i.log.gz 
    appender.rolling.policies.type = Policies
    # 使用基于时间的滚动策略
    appender.rolling.policies.time.type = TimeBasedTriggeringPolicy 
    # 每天滚动日志
    appender.rolling.policies.time.interval = 1 
    # 在日边界上对齐滚动(而不是每24小时滚动一次)
    appender.rolling.policies.time.modulate = true 
    # 使用基于文件大小的滚动策略,比如文件到了100M
    appender.rolling.policies.size.type = SizeBasedTriggeringPolicy 
    # 文件大小在256 MB之后滚动日志
    appender.rolling.policies.size.size = 256MB 
    appender.rolling.strategy.type = DefaultRolloverStrategy
    appender.rolling.strategy.fileIndex = nomax
    # 滚动日志时使用删除操作
    appender.rolling.strategy.action.type = Delete 
    appender.rolling.strategy.action.basepath = ${sys:es.logs.base_path}
    # 只删除匹配文件模式的日志
    appender.rolling.strategy.action.condition.type = IfFileName 
    # 模式是只删除主日志
    appender.rolling.strategy.action.condition.glob = ${sys:es.logs.cluster_name}-* 
    # 只有当我们累积了太多的压缩日志时才删除
    appender.rolling.strategy.action.condition.nested_condition.type = IfAccumulatedFileSize 
    # 压缩日志上的大小条件是2 GB
    appender.rolling.strategy.action.condition.nested_condition.exceeds = 2GB 
    

      

    如果要在指定的时间段内保留日志文件,则可以使用带有删除操作的滚动策略。

    # 配置 DefaultRolloverStrategy
    appender.rolling.strategy.type = DefaultRolloverStrategy 
    # 配置Delete处理滚动的动作
    appender.rolling.strategy.action.type = Delete 
    # Elasticsearch日志的基本路径
    appender.rolling.strategy.action.basepath = ${sys:es.logs.base_path} 
    # 处理滚动时应用的条件
    appender.rolling.strategy.action.condition.type = IfFileName 
    # 从与glob匹配的基本路径中删除文件 ${sys:es.logs.cluster_name}-*; 这是日志文件滚动到的glob; 只需要删除滚动的Elasticsearch日志,而不是删除弃用和慢日志
    appender.rolling.strategy.action.condition.glob = ${sys:es.logs.cluster_name}-* 
    # 嵌套的条件适用于与glob匹配的文件
    appender.rolling.strategy.action.condition.nested_condition.type = IfLastModified 
    # 保留七天的日志
    appender.rolling.strategy.action.condition.nested_condition.age = 7D 
    

      

    原文链接:https://blog.csdn.net/qq_21383435/article/details/79295329

  • 相关阅读:
    unity 颜色空间
    Shader 常用常量 函数等
    Unity3d cg Shader 相关的方法
    DirectX HLSL Shader 内置函数
    unity texture2d 图片尺寸压缩
    Unity中Zxing生成二维码只能生成256大小图片的解决方案
    读取保存 调用系统选框 仅限Win/Mac/WebGL
    Unity编辑器中递归设置文件夹下资源的 AssetBundle Tag 可多选
    扣绿幕Shader(可自选颜色)
    智能手环体验:UP24
  • 原文地址:https://www.cnblogs.com/woniu4/p/9920874.html
Copyright © 2011-2022 走看看