From 5b0f20a54f063cfb688aff1d433897b01f9cb92b Mon Sep 17 00:00:00 2001 From: Hubert Plociniczak Date: Tue, 19 Sep 2023 16:35:39 +0200 Subject: [PATCH] Address some PR requests 1. Log INFO level to CONSOLE by default 2. Change runner's default log level from ERROR to WARN Took a while to figure out why the correct log level wasn't being passed to the language server, therefore ignoring the (desired) verbose logs from the log file. --- engine/launcher/src/main/resources/application.conf | 2 +- engine/runner/src/main/scala/org/enso/runner/Main.scala | 2 +- .../main/scala/org/enso/compiler/SerializationManager.scala | 2 +- .../main/java/org/enso/logging/LoggingServiceManager.java | 2 +- .../project-manager/src/main/resources/application.conf | 5 +++-- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/engine/launcher/src/main/resources/application.conf b/engine/launcher/src/main/resources/application.conf index 2a842e6394738..f1e5b3ca25f0e 100644 --- a/engine/launcher/src/main/resources/application.conf +++ b/engine/launcher/src/main/resources/application.conf @@ -30,7 +30,7 @@ logging-service { pattern = "[%level{lowercase=true}] [%d{yyyy-MM-dd'T'HH:mm:ssXXX}] [%logger] %msg%n%nopex" } ] - default-appender = file + default-appender = console default-appender = ${?ENSO_APPENDER_DEFAULT} always-log-to-file = true always-log-to-file = ${?ENSO_LOG_TO_FILE} diff --git a/engine/runner/src/main/scala/org/enso/runner/Main.scala b/engine/runner/src/main/scala/org/enso/runner/Main.scala index 485aa8a843063..5a802b1df982a 100644 --- a/engine/runner/src/main/scala/org/enso/runner/Main.scala +++ b/engine/runner/src/main/scala/org/enso/runner/Main.scala @@ -1024,7 +1024,7 @@ object Main { /** Default log level to use if the LOG_LEVEL option is not provided. */ - val defaultLogLevel: Level = Level.ERROR + val defaultLogLevel: Level = Level.WARN /** Main entry point for the CLI program. * diff --git a/engine/runtime/src/main/scala/org/enso/compiler/SerializationManager.scala b/engine/runtime/src/main/scala/org/enso/compiler/SerializationManager.scala index 78e53dee603dc..c5cb4f7892af4 100644 --- a/engine/runtime/src/main/scala/org/enso/compiler/SerializationManager.scala +++ b/engine/runtime/src/main/scala/org/enso/compiler/SerializationManager.scala @@ -546,7 +546,7 @@ final class SerializationManager(compiler: Compiler) { pool.shutdownNow() Thread.sleep(100) compiler.context.logSerializationManager( - debugLogLevel, + Level.WARNING, "Serialization manager has been shut down." ) } diff --git a/lib/scala/logging-service/src/main/java/org/enso/logging/LoggingServiceManager.java b/lib/scala/logging-service/src/main/java/org/enso/logging/LoggingServiceManager.java index 37b12214d44e7..6054112ba5f06 100644 --- a/lib/scala/logging-service/src/main/java/org/enso/logging/LoggingServiceManager.java +++ b/lib/scala/logging-service/src/main/java/org/enso/logging/LoggingServiceManager.java @@ -26,7 +26,7 @@ public static Future setupServer( throw new LoggingServiceAlreadySetup(); } else { if (config.appenders().containsKey(config.appender())) { - currentLevel = logLevel; + currentLevel = config.logToFile() ? Level.TRACE : logLevel; return Future.apply( () -> { var server = LoggingServiceFactory.get().localServerFor(port); diff --git a/lib/scala/project-manager/src/main/resources/application.conf b/lib/scala/project-manager/src/main/resources/application.conf index b57eb096aef75..fc496443b9ef1 100644 --- a/lib/scala/project-manager/src/main/resources/application.conf +++ b/lib/scala/project-manager/src/main/resources/application.conf @@ -21,6 +21,7 @@ logging-service { akka.http = warn akka.stream = error akka.routing = error + ch.qos.logback.classic.net.SimpleSocketServer = error } appenders = [ { @@ -31,7 +32,7 @@ logging-service { port = ${?ENSO_LOGSERVER_PORT} }, { - name = "file", + name = "file" }, { name = "console" @@ -66,7 +67,7 @@ logging-service { name = "console" } ] - default-appender = file + default-appender = console default-appender = ${?ENSO_LOGSERVER_APPENDER} } }