-
Notifications
You must be signed in to change notification settings - Fork 323
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
Always log to console and file #7825
Conversation
9adf63e
to
5b0f20a
Compare
This PR now logs to console and log file with INFO and TRACE log levels, respectively, by default. |
5582b7f
to
a30c2e9
Compare
Can we measure what is the cost of always tracing? i.e. on some example run in the CLI or on the startup time in the GUI (probably hard to measure) I hope it is negligible but it would be nice to know the cost. |
The change adds an option by default to always log to a file with verbose log level. The implementation is a bit tricky because in the most common use-case we have to always log in verbose mode to a socket and only later apply the desired log levels. Previously socket appender would respect the desired log level already before forwarding the log. If by default we log to a file, verbose mode is simply ignored and does not override user settings. To test run `project-manager` with `ENSO_LOGSERVER_APPENDER=console` env variable. That will output to the console with the default `INFO` level and `TRACE` log level for the file.
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.
Getting rid of the warning by adding a log4j over slf4j bridge: ``` ERROR StatusLogger Log4j2 could not find a logging implementation. Please add log4j-core to the classpath. Using SimpleLogger to log to the console... ```
Having `application.conf` in `src/main/resources` and `test/resources` does not guarantee that in Tests we will pick up the latter. Instead, by default it seems to do some kind of merge of different configurations, which is far from desired.
Logging to console and (temporary) files is problematic for Windows. The CI also revealed a problem with the native configuration because it was not possible to modify the launcher via env variables as everything was initialized during build time.
bf8f4d1
to
df40ac7
Compare
The difference is negligible in both CLI and server mode, but I will be happy to get some feedback on Windows where it used to be the main pain point. |
PR #7825 enabled parallel logging to a file with a much more fine-grained log level by default. However, logging at `TRACE` level on Windows appears to be still problematic. This PR reduced the default log level to file from `DEBUG` to `TRACE` and allows to control it via an environment variable if one wishes to change the verbosity without making code changes.
* Enable log-to-file configuration PR #7825 enabled parallel logging to a file with a much more fine-grained log level by default. However, logging at `TRACE` level on Windows appears to be still problematic. This PR reduced the default log level to file from `DEBUG` to `TRACE` and allows to control it via an environment variable if one wishes to change the verbosity without making code changes. * PR comments
Pull Request Description
The change adds an option by default to always log to a file with verbose log level.
The implementation is a bit tricky because in the most common use-case we have to always log in verbose mode to a socket and only later apply the desired log levels. Previously socket appender would respect the desired log level already before forwarding the log.
If by default we log to a file, verbose mode is simply ignored and does not override user settings.
Important Notes
To test run
project-manager
. That will output to the console with the defaultINFO
level andTRACE
log level for the file.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.