Skip to content

Commit

Permalink
Don't log to stdout in dev (#27677)
Browse files Browse the repository at this point in the history
* Don't log to stdout in dev
* Add stage to sbt bash script

Co-authored-by: Andrew Nowak <[email protected]>
  • Loading branch information
DanielCliftonGuardian and andrew-nowak authored Dec 18, 2024
1 parent 890abad commit 2eb9bab
Show file tree
Hide file tree
Showing 18 changed files with 108 additions and 15 deletions.
8 changes: 7 additions & 1 deletion admin/conf/logback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,13 @@

<root level="INFO">
<appender-ref ref="LOGFILE"/>
<appender-ref ref="ASYNCSTDOUT"/>
</root>
<if condition='!property("STAGE").contains("DEV")'>
<then>
<root level="INFO">
<appender-ref ref="ASYNCSTDOUT"/>
</root>
</then>
</if>

</configuration>
8 changes: 7 additions & 1 deletion applications/conf/logback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,13 @@

<root level="INFO">
<appender-ref ref="LOGFILE"/>
<appender-ref ref="ASYNCSTDOUT"/>
</root>
<if condition='!property("STAGE").contains("DEV")'>
<then>
<root level="INFO">
<appender-ref ref="ASYNCSTDOUT"/>
</root>
</then>
</if>

</configuration>
8 changes: 7 additions & 1 deletion archive/conf/logback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,13 @@

<root level="INFO">
<appender-ref ref="LOGFILE"/>
<appender-ref ref="ASYNCSTDOUT"/>
</root>
<if condition='!property("STAGE").contains("DEV")'>
<then>
<root level="INFO">
<appender-ref ref="ASYNCSTDOUT"/>
</root>
</then>
</if>

</configuration>
8 changes: 7 additions & 1 deletion article/conf/logback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,13 @@

<root level="INFO">
<appender-ref ref="LOGFILE"/>
<appender-ref ref="ASYNCSTDOUT"/>
</root>
<if condition='!property("STAGE").contains("DEV")'>
<then>
<root level="INFO">
<appender-ref ref="ASYNCSTDOUT"/>
</root>
</then>
</if>

</configuration>
1 change: 1 addition & 0 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ val common = library("common")
pekkoSlf4j,
pekkoSerializationJackson,
pekkoActorTyped,
janino,
) ++ jackson,
TestAssets / mappings ~= filterAssets,
)
Expand Down
8 changes: 7 additions & 1 deletion commercial/conf/logback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,13 @@

<root level="INFO">
<appender-ref ref="LOGFILE"/>
<appender-ref ref="STDOUT"/>
</root>
<if condition='!property("STAGE").contains("DEV")'>
<then>
<root level="INFO">
<appender-ref ref="STDOUT"/>
</root>
</then>
</if>

</configuration>
8 changes: 7 additions & 1 deletion common/test/resources/logback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,13 @@

<root level="INFO">
<appender-ref ref="LOGFILE"/>
<appender-ref ref="ASYNCSTDOUT"/>
</root>
<if condition='!property("STAGE").contains("DEV")'>
<then>
<root level="INFO">
<appender-ref ref="ASYNCSTDOUT"/>
</root>
</then>
</if>

</configuration>
8 changes: 7 additions & 1 deletion dev-build/conf/logback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,13 @@

<root level="INFO">
<appender-ref ref="LOGFILE"/>
<appender-ref ref="STDOUT"/>
</root>
<if condition='!property("STAGE").contains("DEV")'>
<then>
<root level="INFO">
<appender-ref ref="ASYNCSTDOUT"/>
</root>
</then>
</if>

</configuration>
8 changes: 7 additions & 1 deletion discussion/conf/logback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,13 @@

<root level="INFO">
<appender-ref ref="LOGFILE"/>
<appender-ref ref="ASYNCSTDOUT"/>
</root>
<if condition='!property("STAGE").contains("DEV")'>
<then>
<root level="INFO">
<appender-ref ref="ASYNCSTDOUT"/>
</root>
</then>
</if>

</configuration>
8 changes: 7 additions & 1 deletion facia-press/conf/logback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,13 @@

<root level="INFO">
<appender-ref ref="LOGFILE"/>
<appender-ref ref="ASYNCSTDOUT"/>
</root>
<if condition='!property("STAGE").contains("DEV")'>
<then>
<root level="INFO">
<appender-ref ref="ASYNCSTDOUT"/>
</root>
</then>
</if>

</configuration>
8 changes: 7 additions & 1 deletion facia/conf/logback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,13 @@

<root level="INFO">
<appender-ref ref="LOGFILE"/>
<appender-ref ref="ASYNCSTDOUT"/>
</root>
<if condition='!property("STAGE").contains("DEV")'>
<then>
<root level="INFO">
<appender-ref ref="ASYNCSTDOUT"/>
</root>
</then>
</if>

</configuration>
8 changes: 7 additions & 1 deletion identity/conf/logback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@

<root level="INFO">
<appender-ref ref="LOGFILE"/>
<appender-ref ref="ASYNCSTDOUT"/>
</root>
<if condition='!property("STAGE").contains("DEV")'>
<then>
<root level="INFO">
<appender-ref ref="ASYNCSTDOUT"/>
</root>
</then>
</if>
</configuration>
8 changes: 7 additions & 1 deletion onward/conf/logback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,13 @@

<root level="INFO">
<appender-ref ref="LOGFILE"/>
<appender-ref ref="ASYNCSTDOUT"/>
</root>
<if condition='!property("STAGE").contains("DEV")'>
<then>
<root level="INFO">
<appender-ref ref="ASYNCSTDOUT"/>
</root>
</then>
</if>

</configuration>
8 changes: 7 additions & 1 deletion preview/conf/logback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,13 @@

<root level="INFO">
<appender-ref ref="LOGFILE"/>
<appender-ref ref="ASYNCSTDOUT"/>
</root>
<if condition='!property("STAGE").contains("DEV")'>
<then>
<root level="INFO">
<appender-ref ref="ASYNCSTDOUT"/>
</root>
</then>
</if>

</configuration>
1 change: 1 addition & 0 deletions project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ object Dependencies {

val logstash = ("net.logstash.logback" % "logstash-logback-encoder" % "8.0")
.excludeAll(ExclusionRule("com.fasterxml.jackson.core")) // Avoid conflicts with Play's Jackson dependency
val janino = "org.codehaus.janino" % "janino" % "3.1.12"

val targetingClient = "com.gu.targeting-client" %% "client-play-json-v30" % "1.1.9"
val scanamo = "org.scanamo" %% "scanamo" % "2.0.0"
Expand Down
8 changes: 7 additions & 1 deletion rss/conf/logback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,13 @@

<root level="INFO">
<appender-ref ref="LOGFILE"/>
<appender-ref ref="ASYNCSTDOUT"/>
</root>
<if condition='!property("STAGE").contains("DEV")'>
<then>
<root level="INFO">
<appender-ref ref="ASYNCSTDOUT"/>
</root>
</then>
</if>

</configuration>
1 change: 1 addition & 0 deletions sbt
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,5 @@ export APP_SECRET="this_is_not_a_real_secret_just_for_tests"
java $FRONTEND_JVM_ARGS \
$DEBUG_PARAMS \
-Duser.timezone=Australia/Sydney \
-DSTAGE=DEV \
-jar `dirname $0`/bin/sbt-launch.jar "$@"
8 changes: 7 additions & 1 deletion sport/conf/logback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,13 @@

<root level="INFO">
<appender-ref ref="LOGFILE"/>
<appender-ref ref="ASYNCSTDOUT"/>
</root>
<if condition='!property("STAGE").contains("DEV")'>
<then>
<root level="INFO">
<appender-ref ref="ASYNCSTDOUT"/>
</root>
</then>
</if>

</configuration>

0 comments on commit 2eb9bab

Please sign in to comment.