隨筆 - 175  文章 - 202  trackbacks - 0
          <2013年11月>
          272829303112
          3456789
          10111213141516
          17181920212223
          24252627282930
          1234567

          第一個Blog,記錄哈哈的生活

          常用鏈接

          留言簿(16)

          隨筆分類

          隨筆檔案

          文章分類

          文章檔案

          收藏夾

          Java links

          搜索

          •  

          最新評論

          閱讀排行榜

          評論排行榜

          設置了 scanPeriod 之后,過了好長時間,都不生效,后來 debug 代碼。發現了下面這段。

            private volatile long mask = 0xF;
          @Override
          public FilterReply decide(Marker marker, Logger logger, Level level,
          String format, Object[] params, Throwable t) {
          if (!isStarted()) {
          return FilterReply.NEUTRAL;
          }
          // for performance reasons, skip change detection (MASK-1) times out of MASK.
          // Only once every MASK calls is change detection code executed
          // Note that MASK is a variable itself.
          if (((invocationCounter++) & mask) != mask) {
          return FilterReply.NEUTRAL;
          }
          long now = System.currentTimeMillis();
          synchronized (configurationWatchList) {
          updateMaskIfNecessary(now);
          if (changeDetected(now)) {
          // Even though reconfiguration involves resetting the loggerContext,
          // which clears the list of turbo filters including this instance, it is
          // still possible for this instance to be subsequently invoked by another
          // thread if it was already executing when the context was reset.
          disableSubsequentReconfiguration();
          detachReconfigurationToNewThread();
          }
          }
          return FilterReply.NEUTRAL;
          }
          

          這行 if (((invocationCounter++) & mask) != mask) { mask = 0xf,其實要每循環 0xf 次,也就是 15 次,才會去 check 一次是否要更新,也就是說,不管過了多久,如果沒到這 15 次,也不會去檢查是否更新配置。
          也就是說,我多打幾次 log,配置文件就生效了。

          @import url(http://www.aygfsteel.com/CuteSoft_Client/CuteEditor/Load.ashx?type=style&file=SyntaxHighlighter.css);@import url(/css/cuteeditor.css);
          posted on 2013-11-12 14:25 哈哈的日子 閱讀(1625) 評論(0)  編輯  收藏

          只有注冊用戶登錄后才能發表評論。


          網站導航:
           
          主站蜘蛛池模板: 松潘县| 东乡族自治县| 肥乡县| 德格县| 牟定县| 乌拉特前旗| 兴山县| 秭归县| 治县。| 海城市| 娱乐| 玉树县| 嵊泗县| 泰和县| 错那县| 东乌珠穆沁旗| 交口县| 大余县| 梁河县| 沐川县| 丁青县| 禄劝| 滦平县| 常熟市| 望城县| 鹤壁市| 福安市| 南雄市| 揭东县| 垫江县| 阜南县| 休宁县| 抚顺市| 凭祥市| 毕节市| 临海市| 堆龙德庆县| 沭阳县| 哈尔滨市| 铜川市| 廊坊市|