-
Notifications
You must be signed in to change notification settings - Fork 404
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
Improve tracing capability of m2e through m2e.logback.configuration. #1589
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.
Added. |
Would you consider sending a PR at vscode-java side to adopt the new log capability? |
I think this would be the next logical step. Making it easier to do the above steps by enabling some preference. |
OK, i'm saying this to just want a bits to have a look at the whole E2E workflow in VS Code. A few questions here:
|
No, they will be merged into .out-jdt.ls-${date}.log which would be right beside the .log file. The If you want to log directly to The Eclipse workspace
In the process of answering this, I've found a possible issue. While the above isn't enable by default, there is some logging that can happen by default. By just adding the configuration plugin, and if no logback file is defined, it defaults to the logback.xml file stored within the plugin. STDOUT/EclipseLog/MavenConsoleLog won't do anything by default, but FILE will log because
Yes. Without that property, m2e will use the default logback settings, which it generates in |
The org.eclipse.m2e.logback.appender plugin requires the org.eclipse.m2e.core.ui and org.eclipse.ui.* plugins. We can't use it in Java LS. |
Yup, Looks like because of the Maven appender relying on some m2e ui components. So the only remaining concern is about the new INFO-level logging in |
I see. Since this new trace capability is just used to diagnose the language server itself, rather than the user's application, and asking the end user to provide a logback.xml file to enable verbose looks a little too heavy. A more reasonable approach is only exposing one switch |
Now, setting The requirement (in the code) that |
- Add 'org.eclipse.m2e.logback.feature' to target platform - Add 'org.eclipse.m2e.logback' plugin to language server product - When system property 'jdt.ls.debug=true' is set (eg. by java.jdt.ls.vmargs), and 'logback.configurationFile' is not set , verbose (DEBUG) logging will be done on the standard output of JDT-LS. - The system property 'logback.configurationFile' is also available for advanced debugging usages Signed-off-by: Roland Grunberg <rgrunber@redhat.com>
3b54e4a
to
5bc3fc0
Compare
test this please |
I've tested the change with/without |
"test this please" is a github command. It restarts the build. |
test this please |
which one can provide a logback configuration
Signed-off-by: Roland Grunberg rgrunber@redhat.com
A few notes on how this could work :
Suppose we want to log using standard out/err :
In :
/path/to/logback.xml
Now when launching JDT-LS, we need to set
-Dlogback.configurationFile=/path/to/logback.xml -Djdt.ls.debug=true
(The latter ensures JDT-LS will create the correct log files in the workspace
.metadata
folder. One would need to usejava.jdt.ls.vmargs
to set these on the client side.A custom logfile location is also possible, but all that configuration would happen in the logback.xml without the need for setting
jdt.ls.debug=true
Update :
With this change, the default logging for m2e would generate 'INFO' level logging only in
${workspace}/.metadata/.plugins/org.eclipse.m2e.logback.configuration/0.log
.@fbricon