-
Notifications
You must be signed in to change notification settings - Fork 326
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
Let logging to file respect log level #8264
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I use
diff --git a/engine/language-server/src/main/resources/application.conf b/engine/language-server/src/main/resources/application.conf
index c2d9e1ded..eb6ac846c 100644
--- a/engine/language-server/src/main/resources/application.conf
+++ b/engine/language-server/src/main/resources/application.conf
@@ -56,7 +56,7 @@ logging-service {
default-appender = socket
default-appender = ${?ENSO_APPENDER_DEFAULT}
log-to-file {
- enable = false
+ enable = true
enable = ${?ENSO_LOG_TO_FILE}
log-level = debug
log-level = ${?ENSO_LOG_TO_FILE_LOG_LEVEL}
I still have 5 GBs of output in my stdout, even though the default log level to console should be INFO. What is the purpose of log-to-file.enable
property then?
Note that I like to set the log-to-file.log-level = trace
in application.conf
rather than via env variable. That is why I also tried to set log-to-file.enable = true
.
#org.enso.languageserver.protocol.json.JsonConnectionController = debug | ||
#org.enso.jsonrpc.JsonRpcServer = debug | ||
#org.enso.languageserver.runtime.RuntimeConnector = debug | ||
org.enso.languageserver.protocol.json.JsonConnectionController = debug |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice to see that this is uncommented by default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I got fed up with it. In trace
you can't see anything because of it.
It's a problem unrelated to the fact what this PR is fixing but I've been thinking how to best tackle this anyway. As noted internally setting log-to-file for language server that is being started by project-manager makes little sense when using socket appender. It probably would make sense if language server was started separately. For now, just hardcoded the fact that language server should always reset the |
This change fixes a regression introduced in #7918, which prevented the execution from setting the right log level either via env var or parameter. Now passing either of the options returns logs of the expected level in the log file: - `ENSO_LOG_TO_FILE_LOG_LEVEL = trace` - ... `-vv` ...
It makes little sense in the current environment to log to file while also logging to socket, because the latter most of the time is doing that anyway. This change prevents from flodding console with logs. It would make sense to support such feature if language server was started independently (without `project-manager`). Left out the section in language server's `application.conf` in case someone wants to use an appender different from socket one.
0e31d20
to
11a4a07
Compare
Pull Request Description
This change fixes a regression introduced in #7918, which prevented the execution from setting the right log level either via env var or parameter.
Now passing either of the options returns logs of the expected level in the log file:
ENSO_LOG_TO_FILE_LOG_LEVEL = trace
-vv
...Fixes #8274
Checklist
Please ensure that the following checklist has been satisfied before submitting the PR:
Scala,
Java,
and
Rust
style guides. In case you are using a language not listed above, follow the Rust style guide.
./run ide build
.