Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use simple logger #112

Merged
merged 1 commit into from
Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.

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"
}
Loading