Skip to content

Commit

Permalink
Configure test logging (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
kelvin-chappell authored Feb 8, 2024
1 parent e70b24b commit 51c38a9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ lazy val root = (project in file("."))
s"-Dpidfile.path=/dev/null",
s"-J-Dlogs.home=/var/log/${packageName.value}",
),
Test / javaOptions += "-Dlogback.configurationFile=logback-test.xml",
libraryDependencies ++= Seq(
"net.logstash.logback" % "logstash-logback-encoder" % "7.4",
("com.gu" %% "simple-configuration-ssm" % "1.6.4").cross(CrossVersion.for3Use2_13),
Expand Down
16 changes: 16 additions & 0 deletions test/resources/logback-test.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!-- https://www.playframework.com/documentation/latest/SettingsLogger -->
<configuration>

<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<charset>UTF-8</charset>
<pattern>%d{yyyy-MM-dd HH:mm:ss} %highlight(%-5level) %cyan(%logger{36}) %magenta(%X{pekkoSource}) %msg%n
</pattern>
</encoder>
</appender>

<root level="ERROR">
<appender-ref ref="STDOUT"/>
</root>

</configuration>

0 comments on commit 51c38a9

Please sign in to comment.