<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                ## 日志配置 Elasticsearch使用[Log4j2](https://logging.apache.org/log4j/2.x/)進行日志記錄。 Log4j2可以通過log4j2.properties文件進行配置。Elasticsearch公開了三個屬性:`${sys:es.logs.base_path}`、`${sys:es.logs.cluster_name}`、`${sys:es.logs.node_name}`(如果節點名字通過`node.name`明確配置過),這三個屬性可以在配置文件中引用,以確定日志文件的存放路徑; `${sys:es.logs.base_path}`被解析為日志目錄,`${sys:es.logs.cluster_name}`被解析為集群名稱(默認用作日志文件名的前綴),`${sys:es.logs.node_name}`被解析為節點名字(如果節點名字明確配置過)。 例如,如果您的日志目錄(`path.logs`)是`/var/log/elasticsearch`,并且您的集群名為`production`,那么`${sys:es.logs}`將解析為`/var/log/elasticsearch/production`,`${sys:es.logs.base_path}${sys:file.separator}${sys:es.logs.cluster_name}.log`將被解析為`/var/log/elasticsearch/production.log`。 ``` appender.rolling.type = RollingFile appender.rolling.name = rolling 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 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 appender.rolling.policies.time.modulate = true appender.rolling.policies.size.type = SizeBasedTriggeringPolicy 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 appender.rolling.strategy.action.condition.nested_condition.exceeds = 2GB ``` // TODO 如果將`.gz`或`.zip`附加到`appender.rolling.filePattern`,那么日志將在滾動時壓縮。 如果你想保留指定時間段的日志,可以使用一個帶有刪除動作的滾動策略。 ``` appender.rolling.strategy.type = DefaultRolloverStrategy #① appender.rolling.strategy.action.type = Delete #② appender.rolling.strategy.action.basepath = ${sys:es.logs.base_path} #③ appender.rolling.strategy.action.condition.type = IfLastModified #④ appender.rolling.strategy.action.condition.age = 7D #⑤ appender.rolling.strategy.action.PathConditions.type = IfFileName #⑥ appender.rolling.strategy.action.PathConditions.glob = ${sys:es.logs.cluster_name}-* #⑦ ``` ① 配置滾定處理器DefaultRolloverStrategy - - - - - - ② 為滾動滾定處理器配置刪除動作 - - - - - - ③ 日志文件目錄 - - - - - - ④ 指定滾定的條件 - - - - - - ⑤ 保留日志的時間 - - - - - - ⑥ 根據文件名匹配,僅刪除超過7天的文件 - - - - - - ⑦ 根據`${sys:es.logs.cluster_name}-*`格式去匹配刪除文件; 它僅僅只刪除Elasticsearch的日志,不會刪除`deprecation`與`slow`的日志。 可以加載多個配置文件(在這種情況下,它們將被合并),只要它們命名為`log4j2.properties`并將Elasticsearch config目錄作為父目錄; 這對于暴露其他日志記錄器的插件很有用。 日志部分包含java包及其對應的日志級別。 記錄器部分包含日志的目標。 有關如何自定義日志記錄和所有支持的追加器的詳細信息可以在[Log4j文檔](http://logging.apache.org/log4j/2.x/manual/configuration.html)中找到。 ## Configuring logging levels // TODO ## Deprecation(過期)日志 除了常規日志記錄之外,Elasticsearch還允許您啟用日志來記錄一些過期的操作。 例如,這允許您在早期就確定您將需要在未來遷移哪些功能。 默認情況下,過期日志會開啟并以WRAN級別記錄,此級別會記錄所有過期操作的日志。 ``` logger.deprecation.level = warn ``` 它將在日志目錄中創建每日滾動的deprecation日志文件。 定期檢查此文件,特別是當您打算升級到新的主版本。 默認的日志配置已為棄用日志設置了滾動策略,將在1GB之后滾動和壓縮,并且最多保留五個日志文件(四個已滾動的日志和一個正在記錄的日志)。 您可以通過在`config/log4j2.properties`文件中設置deprecation日志級別設置為`error`來禁用它。 > my note > > 日志配置
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看