Skip to content

Commit

Permalink
Merge pull request #112 from guardian/ld/use-simple-logger
Browse files Browse the repository at this point in the history
Use simple logger
  • Loading branch information
lindseydew authored Apr 29, 2024
2 parents fe68030 + 7ba7739 commit 1ac12e4
Show file tree
Hide file tree
Showing 8 changed files with 7 additions and 40 deletions.
8 changes: 1 addition & 7 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ val commonSettings: immutable.Seq[Def.Setting[_]] = List(
jackson,
jacksonDataFormat,
jacksonJsrDataType,
log4j,
commonsIo,
scanamo,
okHttp,
slf4jSimple,
identityAuthCore,
specsCore,
specsScalaCheck,
Expand All @@ -54,12 +54,6 @@ val commonSettings: immutable.Seq[Def.Setting[_]] = List(
case PathList(ps @ _*) if ps.last equalsIgnoreCase "Log4j2Plugins.dat" => sbtassembly.Log4j2MergeStrategy.plugincache
case _ => MergeStrategy.first
},
dependencyOverrides ++= Seq(
commonsLogging,
slf4jApi,
apacheLog4JCore,
apacheLog$jApi
),
organization := "com.gu",
version := "1.0",
scalaVersion := "2.12.19",
Expand Down
5 changes: 3 additions & 2 deletions common/src/main/scala/com/gu/sfl/Logging.scala
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package com.gu.sfl

import org.apache.logging.log4j.LogManager
import org.slf4j.Logger
import org.slf4j.LoggerFactory

import scala.util.{Failure, Success, Try}

trait Logging {
val logger = LogManager.getLogger(this.getClass.getName)
val logger: Logger = LoggerFactory.getLogger(this.getClass)

def logOnThrown[T](function: () => T, messageOnError: String = ""): T = Try(function()) match {
case Success(value) => value
Expand Down
15 changes: 0 additions & 15 deletions mobile-save-for-later-user-deletion/src/main/resources/log4j2.xml

This file was deleted.

Empty file.
15 changes: 0 additions & 15 deletions mobile-save-for-later/src/main/resources/log4j2.xml

This file was deleted.

Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package com.gu.sfl.lambda

import java.io.{ByteArrayInputStream, ByteArrayOutputStream}

import org.apache.logging.log4j.core.Logger
import org.slf4j.Logger
import org.specs2.mock.Mockito
import org.specs2.mutable.Specification

Expand Down
2 changes: 2 additions & 0 deletions project/dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,6 @@ object Dependencies {
val slf4jApi = "org.slf4j" % "slf4j-api" % "1.7.25"
val apacheLog4JCore = "org.apache.logging.log4j" % "log4j-core" % log4j2Version
val apacheLog$jApi = "org.apache.logging.log4j" % "log4j-api" % log4j2Version % "provided"

val slf4jSimple = "org.slf4j" % "slf4j-simple" % "2.0.13"
}

0 comments on commit 1ac12e4

Please sign in to comment.