1
當前logback.xml如何在java logback中打印自定義堆棧跟蹤?
<appender name="FILEOUT3" class="ch.qos.logback.core.FileAppender">
<file>D:/${byDay}.log</file>
<append>true</append>
<encoder>
<Pattern>%d{HH:mm:ss} %-5level %msg%replace(%xException){"\n", ">> "}%nopex%n</Pattern>
</encoder>
</appender>
當前的結果:
play.api.Configuration$$anon$1: Configuration error[Cannot connect to database [default]] >> at play.api.Configuration$.play$api$Configuration$$configError(Configuration.scala:92) ~[play_2.10-2.2.0.jar:2.2.0] >> at play.api.Configuration.reportError(Configuration.scala:570) ~[play_2.10-2.2.0.jar:2.2.0] >> at play.api.db.BoneCPPlugin$$anonfun$onStart$1.apply(DB.scala:252) ~[play-jdbc_2.10-2.2.0.jar:2.2.0]
我想結果是:
[12:43:16.454] play.api.Configuration$$anon$1: Configuration error[Cannot connect to database [default]] [12:43:16.454] at play.api.Configuration$.play$api$Configuration$$configError(Configuration.scala:92) ~[play_2.10-2.2.0.jar:2.2.0] [12:43:16.454] at play.api.Configuration.reportError(Configuration.scala:570) ~[play_2.10-2.2.0.jar:2.2.0] [12:43:16.454] at play.api.db.BoneCPPlugin$$anonfun$onStart$1.apply(DB.scala:252) ~[play-jdbc_2.10-2.2.0.jar:2.2.0] : : more 40 lines : [12:43:16.454] at play.api.db.BoneCPPlugin$$anonfun$onStart$1.apply(DB.scala:252) ~[play-jdbc_2.10-2.2.0.jar:2.2.0]
重要!
同時打印
我想知道的。
如何更改logback.xml?
謝謝!你能把簡單的代碼發給我嗎? [email protected] /我很抱歉。我的英語不太好。 –
更換/模式錯誤:(如何修復源代碼? –
您能澄清您的評論嗎?我不確定我是否關注您 –