Skip to content

Commit

Permalink
Merge pull request #1062 from guardian/aa/log-shipping
Browse files Browse the repository at this point in the history
Adopt log shipping via DevX logs
  • Loading branch information
akash1810 authored Nov 7, 2023
2 parents b278afd + a81401d commit 8582036
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 163 deletions.
1 change: 0 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ lazy val hq = (project in file("hq"))
// exclude transitive dependency to avoid a runtime exception:
// `com.fasterxml.jackson.databind.JsonMappingException: Scala module 2.10.2 requires Jackson Databind version >= 2.10.0 and < 2.11.0`
"net.logstash.logback" % "logstash-logback-encoder" % "7.3" exclude("com.fasterxml.jackson.core", "jackson-databind"),
"com.gu" % "kinesis-logback-appender" % "2.1.0",
"com.gu" %% "janus-config-tools" % "0.0.5"
),
Assets / pipelineStages := Seq(digest),
Expand Down
5 changes: 5 additions & 0 deletions cdk/lib/__snapshots__/security-hq.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,11 @@ exports[`HQ stack matches the snapshot 1`] = `
"PropagateAtLaunch": true,
"Value": "PROD",
},
{
"Key": "SystemdUnit",
"PropagateAtLaunch": true,
"Value": "security-hq.service",
},
],
"TargetGroupARNs": [
{
Expand Down
3 changes: 3 additions & 0 deletions cdk/lib/security-hq.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ export class SecurityHQ extends GuStack {
const domainName = "security-hq.gutools.co.uk";

const ec2App = new GuEc2App(this, {
applicationLogging: {
enabled: true
},
access: {
scope: AccessScope.PUBLIC,
},
Expand Down
11 changes: 0 additions & 11 deletions hq/app/AppLoader.scala
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import config.LoggingConfig
import logging.LogConfig
import play.api.ApplicationLoader.Context
import play.api.{Application, ApplicationLoader, Mode}

Expand All @@ -8,15 +6,6 @@ import scala.concurrent.Future

class AppLoader extends ApplicationLoader {
override def load(context: Context): Application = {
val loggingConfig = LoggingConfig(
context.initialConfiguration,
sys.env.getOrElse("LOCAL_LOG_SHIPPING", "false").toBoolean
)

LogConfig.initPlayLogging(context)
LogConfig.initRemoteLogShipping(loggingConfig)
LogConfig.initLocalLogShipping(loggingConfig)

val components = new AppComponents(context)

components.application
Expand Down
30 changes: 0 additions & 30 deletions hq/app/config/LoggingConfig.scala

This file was deleted.

117 changes: 0 additions & 117 deletions hq/app/logging/LogConfig.scala

This file was deleted.

4 changes: 0 additions & 4 deletions sbt
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ do
CONF_PARAMS=""
shift
fi
if [ "$arg" == "--ship-logs" ]; then
export LOCAL_LOG_SHIPPING=true
shift
fi
done

java $DEBUG_PARAMS \
Expand Down

0 comments on commit 8582036

Please sign in to comment.