-
Notifications
You must be signed in to change notification settings - Fork 746
feat(amazonq): write logs to disk with rotation & cleanup #7691
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
Conversation
|
| traceServerEnabled ? 'Amazon Q Language Server' : 'Amazon Q Logs', | ||
| extensionContext, | ||
| traceServerEnabled | ||
| ? vscode.window.createOutputChannel('Amazon Q Language Server', { log: true }) |
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.
Why do we are using Amazon Q Language Server in VSC? to align with Flare?
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.
+1
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.
This where the flare logs get printed they don't get printed through flare its in the toolkit. We are just trying to maintain the functionality here so that current std out experience doesn't change while enabling the logs on disk.
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.
Ahh I see if the tranceServerEnabled then we print logs to VSC
That make sense!
but this is existing right? Why do we need todo add this check again?
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.
Thats not how it works currently. We print all logs to VSC currently. If the setting is on, then we just take some of the logs to a different stdout for clean separation.
When interested in writing to the disk. I am trying to maintain the same behavior so that while std out separates based on the setting. The logs keep printing to the same file regardless. Thats why the check check moved to the top.
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.
Thats not how it works currently. We print all logs to VSC currently. If the setting is on, then we just take some of the logs to a different stdout for clean separation.
Can you point me to the logic, we have today? just for context but not a blocking for this PR.
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.
packages/amazonq/src/lsp/client.ts
Sure! This file that we have open and commenting on is the logic that governs this. This is where we decide what to put where as far as LSP logs are concerned.
laileni-aws
left a comment
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.
Thanks for this PR. As you already investigated this issue, can you please document this in the repository about types of logs and how we extract them. If not even comment works.
Sure there are more PRs to come. Once this is done, I will write some documentation about the whole flow. |
laileni-aws
left a comment
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.
- If there are any followUp PR's which is dependent or in progress.
- I recommend creating a feature branch and push your changes to the feature branch and later we can bulk merge to master.
- If you feel these PR are independent and can go to master individually with out change in functionality. Ignore this.
|
Sure I have separated them sort of as small features at this time. |
Problem:
Amazon Q extension lacks persistent logging to disk, making it difficult to debug issues after they occur. Customers have no easy way to get them to us. This commit is one in a series to enable 1 click log retrieval on the IDE.
Old log on std out starting point:

Solution:
You can search now for 'Logging with' in the terminal and you will find the path of the log. The log is getting stored at per workspace level.
Implement RotatingLogChannel for disk-based logging
File Log Sample:

feature/xbranches will not be squash-merged at release time.