mirror of
https://github.com/OpenBankProject/API-Explorer.git
synced 2026-02-06 10:47:23 +00:00
Bumped up logback version, added MDC to boot
This commit is contained in:
parent
b734459a0e
commit
9147a77046
2
pom.xml
2
pom.xml
@ -78,7 +78,7 @@
|
||||
<dependency>
|
||||
<groupId>ch.qos.logback</groupId>
|
||||
<artifactId>logback-classic</artifactId>
|
||||
<version>1.1.7</version>
|
||||
<version>1.2.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
|
||||
@ -38,16 +38,13 @@ import common._
|
||||
import http._
|
||||
import sitemap._
|
||||
import Loc._
|
||||
import mapper._
|
||||
import Helpers._
|
||||
import json.JsonDSL._
|
||||
import net.liftmodules.widgets.tablesorter.TableSorter
|
||||
import java.io.FileInputStream
|
||||
import java.io.File
|
||||
import code.lib.{OAuthClient, ObpGet, ObpJson, ObpAPI}
|
||||
import ObpJson._
|
||||
import code.snippet._
|
||||
import code.util.MyExceptionLogger
|
||||
|
||||
import code.lib.{OAuthClient, ObpJson}
|
||||
import code.util.{Helper, MyExceptionLogger}
|
||||
|
||||
/**
|
||||
* A class that's instantiated early and run. It allows the application
|
||||
@ -56,6 +53,9 @@ import code.util.MyExceptionLogger
|
||||
class Boot extends Loggable{
|
||||
def boot {
|
||||
|
||||
MDC.clear()
|
||||
MDC.put( ("host", Helper.getHostname()) )
|
||||
|
||||
val runningMode = Props.mode match {
|
||||
case Props.RunModes.Production => "Production mode"
|
||||
case Props.RunModes.Staging => "Staging mode"
|
||||
|
||||
@ -3,6 +3,7 @@ package code.util
|
||||
import code.lib.ObpAPI._
|
||||
import code.lib.ObpJson.AccountJson
|
||||
import net.liftweb.common.Full
|
||||
import net.liftweb.util.Props
|
||||
|
||||
|
||||
object Helper {
|
||||
@ -43,7 +44,15 @@ Returns a string which can be used for the title of the account
|
||||
}
|
||||
|
||||
|
||||
|
||||
def getHostname(): String = {
|
||||
Props.get("hostname", "") match {
|
||||
case s: String if s.nonEmpty => s.split(":").lift(1) match {
|
||||
case Some(s) => s.replaceAll("\\/", "").replaceAll("\\.", "-")
|
||||
case None => "unknown"
|
||||
}
|
||||
case _ => "unknown"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user