paulwong

          My Links

          Blog Stats

          常用鏈接

          留言簿(67)

          隨筆分類(1389)

          隨筆檔案(1147)

          文章分類(7)

          文章檔案(10)

          相冊

          收藏夾(2)

          AI

          Develop

          E-BOOK

          Other

          養生

          微服務

          搜索

          最新評論

          閱讀排行榜

          評論排行榜

          60天內閱讀排行

          LOGBACK TUTORIA

          https://github.com/abdulwaheed18/Slf4jTutorial 

          http://stackoverflow.com/questions/10465301/tomcat-war-configure-logback-to-use-app-name-in-path

          <configuration>

              <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
                  <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
                      <Pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
                      </Pattern>
                  </encoder>
              </appender>


              <appender name="FILE"
                  class
          ="ch.qos.logback.core.rolling.RollingFileAppender">
                  <file>testFile7.log</file>
                  <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
                      <!-- daily rollover
                      Once any of the below condition met, it will change the file name as below and compressed it. 
          -->

                      <fileNamePattern>logFile.%d{yyyy-MM-dd}.%i.log.zip
                      </fileNamePattern>

                      <!-- keep 30 days' worth of history -->
                      <maxHistory>30</maxHistory>
                      <!-- or whenever the file size reaches 10MB -->
                      <timeBasedFileNamingAndTriggeringPolicy
                          
          class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
                          <maxFileSize>10MB</maxFileSize>
                      </timeBasedFileNamingAndTriggeringPolicy>
                  </rollingPolicy>

                  <encoder>
                      <pattern>%-4relative [%thread] %-5level %logger{35} - %msg%n
                      </pattern>
                  </encoder>
              </appender>

              <root level="INFO">
                  <appender-ref ref="STDOUT" />
                  <appender-ref ref="FILE" />
              </root>
          </configuration>

          posted on 2014-04-03 08:10 paulwong 閱讀(523) 評論(0)  編輯  收藏 所屬分類: J2EEJ2SELOGBACK

          主站蜘蛛池模板: 天长市| 和龙市| 剑河县| 巩义市| 通许县| 顺义区| 秭归县| 深泽县| 济南市| 蒲城县| 香港 | 棋牌| 文成县| 黎川县| 班玛县| 呼伦贝尔市| 义马市| 新津县| 周口市| 垦利县| 西丰县| 侯马市| 礼泉县| 濮阳县| 松阳县| 孟村| 宜阳县| 阳曲县| 洛隆县| 伊春市| 鄂温| 尉氏县| 凤翔县| 晋江市| 贞丰县| 海伦市| 武汉市| 东平县| 永胜县| 英吉沙县| 浦东新区|