-
Notifications
You must be signed in to change notification settings - Fork 463
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
Add commands to view Java Language Server debug and error logs #2375
Conversation
6271151
to
eb47b01
Compare
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.
I think exposing the stdout/stderror logs of the server is a good idea for those wishing to get more information.
@testforstephen , let me know if you're fine with such an addition.
package.nls.json
Outdated
"java.open.serverDebugLog": "Open Java Language Server Debug Log File", | ||
"java.open.serverErrorLog": "Open Java Language Server Error Log File", |
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.
I wonder whether it makes sense to rename these, since they aren't exactly what's listed.
We have 4 log files :
- the client log : this is just the logs on the client side that document the interaction between the client and server
- the server log : this is the Eclipse Platform logging service. That's why you see the
!ENTRY...!Message
for every entry. They are actually meant to be shown to the user in a table, by any plugin that wishes to report something. - the standard output/error logs : These are what this PR is exposing. If you look at https://github.com/eclipse/eclipse.jdt.ls/blob/master/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/JavaLanguageServerPlugin.java#L518-L528 , you'll see that's the case. However, only when
jdt.ls.debug
is set totrue
.
Basically, I would probably call them :
Open Java Language Server Standard Output Log File
Open Java Language Server Standard Error Log File
Things like SERVER_DEBUG or serverDebug should probably become SERVER_STDOUT / serverStdout
Things like SERVER_ERROR or serverError should probably become SERVER_STDERR / serverStderr
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.
@rgrunber Thank you very much for this feedback. I've pushed a correction for this now.
What do you think about alerting with instructions to set jdt.ls.debug
to true
if those files can't be found? I'll experiment a little with that.
I'm thinking who is the audience for these logs. To me, extension developers might be interested in these logs, but normal users might not be. If this is the case, I'd rather not expose too many log commands in the Command Palette, and instead reuse the existing command We can refactor this to
|
@testforstephen I started down this path because I wanted to see the logs from Maven; effectively the Maven Console I missed from Eclipse. @rgrunber directed me to the files, including how to activate them, in #2367. The contents of the stdout (I think) is actually what I expected to see in the Maven output window in VS Code… whereas at least for me that output only ever consists of one line identifying my local repository. Given how much Maven does, seeing its output is actually something I'm regularly interested in, especially when I'm pondering how long it's taking and how much processing power it's using! I do agree that the approach I've used in this PR is a proliferation of options. Perhaps it would be possible to channel items from at least one of these logs into the Maven Output window, so it's directly accessible? |
|
@rgrunber sorry, too many plugins! The Maven Output is from the Maven plugin. It has an entry in the Output tab, but it's underused. It's always where I imagined the Maven log would appear. I discovered when I started my investigation there that the Maven plugin didn't control m2e but forgot! If we can't extract just the m2e bits then getting the logs into the Java Language Server Output would be great. |
Going through trying to get the EclipseLogAppender working made me discover we have an issue with custom logback configs : eclipse-jdtls/eclipse.jdt.ls#2077 , so the discussion is definitely appreciated. I was able to get some of the events to be logged to the language server
|
6f2f976
to
b1357a9
Compare
- Open log files in same view column, outside preview-mode for better visibility Resolves redhat-developer#2367 Signed-off-by: Karl von Randow <karl@xk72.com>
b1357a9
to
b36563c
Compare
I'll be pushing this in since @karlvr did some good work to get this ready. I've used The Maven related logging will show up under the server logs once the logback tracing PR is merged. It's still good to be able to view the stdout/stderr logs. Further improvements might involve adding a quick-pick menu to select which (of the 4) logs. |
@@ -924,13 +924,19 @@ | |||
}, | |||
{ | |||
"command": "java.open.serverLog", | |||
"title": "%java.open.serverLog%", | |||
"category": "Java" | |||
"when": "false" |
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.
Oh, you hide this command. "Open Java Language Server Log File" is the most frequently command I use for troubleshooting.
You need to update wiki as well.
https://github.com/redhat-developer/vscode-java/wiki/Troubleshooting
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.
I"m open to restoring it, if you feel the convenience of not having the other 3 log files show up is worth it.
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'd like to keep server log command.
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.
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.
Agreed. For those commands that are taken as APIs, we don't need to declare it in package.json.
Resolves #2367, which in spite of being closed wasn't resolved as such (we found out how to view the logs but didn't make it easy)