Skip to content

Enable the ability to log the payloads on the server side #181

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

Open
TylerLeonhardt opened this issue Oct 6, 2019 · 7 comments
Open

Enable the ability to log the payloads on the server side #181

TylerLeonhardt opened this issue Oct 6, 2019 · 7 comments

Comments

@TylerLeonhardt
Copy link
Collaborator

In the PowerShell extension, we ask users to upload the logs that all come from a central folder. This includes:

  • client logs (vscode-powershell)
  • startup logs before the language server is up
  • language server logs (PowerShell Editor Services)

This includes everything including payloads. We also have 1 setting that handles what is included in the logs:

powerShell.developer.logLevel

That maps to a log level in the server.

Since csharp-lsp doesn't give us the ability to log the payload server side, we will have to adapt to a more complicated logging story... relying on the user to use both powerShell.developer.logLevel and powershell.trace.server in order to get verbose logs from the vscode client side.

Also, we will have to tell the user to copy language server logs from the output window, and attach the other logs from the file system. It's messy.

If csharp-lsp exposed a way to include payloads in logging, then we would be able to keep our simple system that folks already know.

@tintoy
Copy link
Collaborator

tintoy commented Oct 6, 2019

I added this functionality to the client's implementation of LspConnection a while back so it shouldn't be too hard retrofit to the server-side LspConnection.

The tricky part, server-side, would be preventing a log-loop; the LanguageServerLogger needs to detect - possibly via an AsyncLocal<T> or something - that it's logging a message generated by the LspConnection component and not submit a log message for transmission 😁

@tintoy
Copy link
Collaborator

tintoy commented Oct 6, 2019

(really, at some point, the 2 implementations of LspConnection should be reintegrated - having 2 implementations of the send / receive / serialisation logic just doubles the maintenance workload 😉)

@TylerLeonhardt
Copy link
Collaborator Author

The tricky part, server-side, would be preventing a log-loop

Yes! That is tricky. I guess, Log messages don't need to be logged (as odd as that sounds...)

@TylerLeonhardt
Copy link
Collaborator Author

TylerLeonhardt commented Oct 7, 2019

side note, I think if this VS Code issue was resolved, I'd feel a lot more comfortable depending on the output windows... but since that's not really a thing, telling the user to "copy paste these files" seems a lot easier than "copy the following Output windows: X, Y, Z"

@david-driscoll
Copy link
Member

@TylerLeonhardt did this get resolved with PowerShell/PowerShellEditorServices#1066?

@TylerLeonhardt
Copy link
Collaborator Author

No that added our logs to a file, but the payload of the LSP requests are not added to those logs.

I can only see the payload in the output pane using the "powershell editor services.trace.server":"verbose" setting

@david-driscoll
Copy link
Member

ohhhhhhhhhh, okay I'm slow. You're looking for the payloads themselves to be output, okay. That will take some thinking. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants