Skip to content

Commit c363609

Browse files
committed
#275 Disable log4j2 to use slf4j
1 parent f36b141 commit c363609

File tree

6 files changed

+13
-12
lines changed

6 files changed

+13
-12
lines changed

build.sbt

+9
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
11
name := "TheHive"
22

33
lazy val thehiveBackend = (project in file("thehive-backend"))
4+
.enablePlugins(PlayScala)
45
.settings(publish := {})
56

67
lazy val thehiveMetrics = (project in file("thehive-metrics"))
8+
.enablePlugins(PlayScala)
79
.dependsOn(thehiveBackend)
810
.settings(publish := {})
911

1012
lazy val thehiveMisp = (project in file("thehive-misp"))
13+
.enablePlugins(PlayScala)
1114
.dependsOn(thehiveBackend)
1215
.settings(publish := {})
1316

1417
lazy val thehiveCortex = (project in file("thehive-cortex"))
18+
.enablePlugins(PlayScala)
1519
.dependsOn(thehiveBackend)
1620
.settings(publish := {})
1721
.settings(SbtScalariform.scalariformSettings: _*)
@@ -26,6 +30,11 @@ lazy val thehive = (project in file("."))
2630
.settings(PublishToBinTray.settings: _*)
2731
.settings(Release.settings: _*)
2832

33+
34+
// Redirect logs from ElasticSearch (which uses log4j2) to slf4j
35+
libraryDependencies += "org.apache.logging.log4j" % "log4j-to-slf4j" % "2.9.0"
36+
excludeDependencies += "org.apache.logging.log4j" % "log4j-core"
37+
2938
lazy val rpmPackageRelease = (project in file("package/rpm-release"))
3039
.enablePlugins(RpmPlugin)
3140
.settings(

thehive-backend/app/services/TheHiveAuthSrv.scala

+2-5
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,11 @@ package services
33
import javax.inject.{ Inject, Singleton }
44

55
import scala.collection.immutable
6-
import scala.concurrent.{ ExecutionContext, Future }
7-
import scala.util.{ Failure, Success }
6+
import scala.concurrent.ExecutionContext
87

9-
import play.api.mvc.RequestHeader
108
import play.api.{ Configuration, Logger }
119

12-
import org.elastic4play.AuthenticationError
13-
import org.elastic4play.services.{ AuthContext, AuthSrv }
10+
import org.elastic4play.services.AuthSrv
1411
import org.elastic4play.services.auth.MultiAuthSrv
1512

1613
object TheHiveAuthSrv {

thehive-backend/build.sbt

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ libraryDependencies ++= Seq(
1212
Library.reflections
1313
)
1414

15-
enablePlugins(PlayScala)
15+
play.sbt.routes.RoutesKeys.routesImport -= "controllers.Assets.Asset"

thehive-cortex/build.sbt

-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,3 @@ libraryDependencies ++= Seq(
88
Library.zip4j
99
)
1010

11-
enablePlugins(PlayScala)

thehive-metrics/build.sbt

-2
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,3 @@ libraryDependencies ++= Seq(
1414
"io.dropwizard.metrics" % "metrics-ganglia" % "3.1.2",
1515
"info.ganglia.gmetric4j" % "gmetric4j" % "1.0.10"
1616
)
17-
18-
enablePlugins(PlayScala)

thehive-misp/build.sbt

+1-3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,4 @@ libraryDependencies ++= Seq(
66
Library.Play.ahc,
77
Library.zip4j,
88
Library.elastic4play
9-
)
10-
11-
enablePlugins(PlayScala)
9+
)

0 commit comments

Comments
 (0)