[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [libeufin] branch master updated: fix log-file
From: |
gnunet |
Subject: |
[GNUnet-SVN] [libeufin] branch master updated: fix log-file |
Date: |
Tue, 24 Sep 2019 15:58:34 +0200 |
This is an automated email from the git hooks/post-receive script.
marcello pushed a commit to branch master
in repository libeufin.
The following commit(s) were added to refs/heads/master by this push:
new 7f98ce8 fix log-file
7f98ce8 is described below
commit 7f98ce8b871978e9c27d6e8015947b5cc6141f76
Author: Marcello Stanisci <address@hidden>
AuthorDate: Tue Sep 24 15:58:25 2019 +0200
fix log-file
---
src/main/kotlin/Main.kt | 2 +-
src/main/kotlin/tech/libeufin/GetLogger.kt | 30 ++++++++++++++++++++++--------
2 files changed, 23 insertions(+), 9 deletions(-)
diff --git a/src/main/kotlin/Main.kt b/src/main/kotlin/Main.kt
index ed1ed04..ddc5d8c 100644
--- a/src/main/kotlin/Main.kt
+++ b/src/main/kotlin/Main.kt
@@ -32,7 +32,7 @@ import tech.libeufin.messages.HEVResponseDataType
import tech.libeufin.messages.ProtocolAndVersion
import javax.xml.bind.JAXBElement
-fun main( ) {
+fun main() {
var xmlProcess = XMLTransform()
var logger = getLogger()
diff --git a/src/main/kotlin/tech/libeufin/GetLogger.kt
b/src/main/kotlin/tech/libeufin/GetLogger.kt
index 1902a2d..be03ba3 100644
--- a/src/main/kotlin/tech/libeufin/GetLogger.kt
+++ b/src/main/kotlin/tech/libeufin/GetLogger.kt
@@ -1,21 +1,35 @@
package tech.libeufin;
-import ch.qos.logback.classic.Level;
-import org.slf4j.LoggerFactory;
-import ch.qos.logback.core.FileAppender;
-import ch.qos.logback.classic.spi.ILoggingEvent;
-import ch.qos.logback.classic.Logger;
-import ch.qos.logback.classic.LoggerContext;
+import ch.qos.logback.classic.Level
+import org.slf4j.LoggerFactory
+import ch.qos.logback.core.FileAppender
+import ch.qos.logback.classic.spi.ILoggingEvent
+import ch.qos.logback.classic.Logger
+import ch.qos.logback.classic.encoder.PatternLayoutEncoder
+import ch.qos.logback.classic.LoggerContext
fun getLogger(): Logger {
- val lc = LoggerFactory.getILoggerFactory() as LoggerContext
- val logger: Logger = LoggerFactory.getLogger("libeufin-sandbox") as Logger
+ val lc: LoggerContext = LoggerFactory.getILoggerFactory() as LoggerContext
+ val logger: Logger = LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME) as
Logger
val fa = FileAppender<ILoggingEvent>()
+ val le = PatternLayoutEncoder()
+ // appender setup
fa.context = lc
+ fa.name = "libeufin"
+ fa.isAppend = true
fa.file = "server.log"
+
+ // encoder setup
+ le.context = lc
+ le.pattern = "%date [%level]: %msg\n"
+
+ // link && start
+ le.start()
+ fa.encoder = le
fa.start()
logger.addAppender(fa)
+
logger.level = Level.DEBUG
return logger
}
--
To stop receiving notification emails like this one, please contact
address@hidden.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] [libeufin] branch master updated: fix log-file,
gnunet <=