mirror of
https://github.com/bitcoin-s/bitcoin-s.git
synced 2025-03-13 03:12:06 +01:00
Refactor logback configuration to reduce repetition (#499)
This commit is contained in:
parent
ed0e952336
commit
0fd70dc8e1
8 changed files with 20 additions and 77 deletions
|
@ -1,23 +0,0 @@
|
|||
<configuration>
|
||||
|
||||
<appender name="FILE" class="ch.qos.logback.core.FileAppender">
|
||||
<file>log/bench.log</file>
|
||||
<encoder>
|
||||
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger{5}.%M\(%line\) - %msg%n</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger{5}.%M\(%line\) - %msg%n</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
|
||||
<root level="INFO">
|
||||
<appender-ref ref="STDOUT" />
|
||||
<appender-ref ref="FILE"/>
|
||||
</root>
|
||||
|
||||
|
||||
</configuration>
|
|
@ -75,8 +75,13 @@ lazy val commonSettings = List(
|
|||
testOptions in Test += Tests.Argument(TestFrameworks.ScalaTest, "-oD"),
|
||||
assemblyOption in assembly := (assemblyOption in assembly).value
|
||||
.copy(includeScala = false),
|
||||
/**
|
||||
* We want to exclude loback config from our published library, so that users don't
|
||||
* get our config forced on them
|
||||
*/
|
||||
Compile / unmanagedResources := (Compile / unmanagedResources).value
|
||||
.filterNot { _.getName.endsWith(".xml") },
|
||||
licenses += ("MIT", url("http://opensource.org/licenses/MIT")),
|
||||
|
||||
/**
|
||||
* Adding Ammonite REPL to test scope, can access both test and compile
|
||||
* sources. Docs: http://ammonite.io/#Ammonite-REPL
|
||||
|
@ -96,7 +101,7 @@ lazy val commonSettings = List(
|
|||
)
|
||||
|
||||
lazy val commonTestSettings = Seq(
|
||||
publish / skip := true,
|
||||
publish / skip := true
|
||||
) ++ commonSettings
|
||||
|
||||
lazy val commonTestWithDbSettings = Seq(
|
||||
|
|
|
@ -1,4 +1,8 @@
|
|||
<included>
|
||||
<!-- Stop output INFO at start -->
|
||||
<statusListener class="ch.qos.logback.core.status.NopStatusListener" />
|
||||
|
||||
|
||||
<appender name="FILE" class="ch.qos.logback.core.FileAppender">
|
||||
<file>logs/application.log</file>
|
||||
<encoder>
|
||||
|
@ -8,13 +12,13 @@
|
|||
|
||||
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{5}.%M\(%line\) - %msg%n</pattern>
|
||||
<pattern>%d{HH:mm:ss.SSS} %level %logger{0} - %msg%n</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
|
||||
|
||||
<root level="OFF">
|
||||
<root level="INFO">
|
||||
<appender-ref ref="FILE" />
|
||||
<appender-ref ref="STDOUT" />
|
||||
</root>
|
||||
|
|
7
core/src/main/resources/logback.xml
Normal file
7
core/src/main/resources/logback.xml
Normal file
|
@ -0,0 +1,7 @@
|
|||
<configuration>
|
||||
<!-- Although this file is on the core project classpath,
|
||||
we exclude all XML files from being included in published
|
||||
artifacts. This way users of Bitcoin-S won't get our config
|
||||
pushed on them. -->
|
||||
<include resource="common-logback.xml" />
|
||||
</configuration>
|
|
@ -1,22 +0,0 @@
|
|||
<configuration>
|
||||
|
||||
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger{5}.%M\(%line\) - %msg%n</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<appender name="FILE" class="ch.qos.logback.core.FileAppender">
|
||||
<file>logs/doc.log</file>
|
||||
<encoder>
|
||||
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger{5}.%M\(%line\) - %msg%n</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<logger name="slick" level="INFO"/>
|
||||
<root level="DEBUG">
|
||||
<appender-ref ref="STDOUT" />
|
||||
<appender-ref ref="FILE"/>
|
||||
</root>
|
||||
|
||||
</configuration>
|
|
@ -1,3 +0,0 @@
|
|||
<configuration>
|
||||
<include resource="common-logback.xml" />
|
||||
</configuration>
|
|
@ -1,22 +0,0 @@
|
|||
<configuration>
|
||||
|
||||
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger{5}.%M\(%line\) - %msg%n</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<appender name="FILE" class="ch.qos.logback.core.FileAppender">
|
||||
<file>logs/doc.log</file>
|
||||
<encoder>
|
||||
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger{5}.%M\(%line\) - %msg%n</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<logger name="slick" level="INFO"/>
|
||||
<root level="DEBUG">
|
||||
<appender-ref ref="STDOUT" />
|
||||
<appender-ref ref="FILE"/>
|
||||
</root>
|
||||
|
||||
</configuration>
|
|
@ -1,3 +0,0 @@
|
|||
<configuration>
|
||||
<include resource="common-logback.xml" />
|
||||
</configuration>
|
Loading…
Add table
Reference in a new issue