-
Notifications
You must be signed in to change notification settings - Fork 268
fix logs only for >=400 #3709
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
base: master
Are you sure you want to change the base?
fix logs only for >=400 #3709
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.
🤖 AI Security analysis: "No security issues were detected in the changed files. Residual risk remains from undetected vulnerabilities or insufficient tests; continue standard security scans and reviews."
| Risk Level | AI Score |
|---|---|
| 🟢 NO RISK | 0.0/100 |
Top 0 security issues / 0 total (Critical: 0, High: 0, Medium: 0, Low: 0)
| Title | Location | Recommendation |
|---|---|---|
| — | — | No issues to display |
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.
🤖 AI Security analysis: "Automated scans found no security issues in the two changed files. Risk appears low, but residual/undetected risks remain; ensure manual review and CI checks before merge."
| Risk Level | AI Score |
|---|---|
| 🟢 NO RISK | 0.0/100 |
Top 0 security issues / 0 total (Critical: 0, High: 0, Medium: 0, Low: 0)
| Title | Location | Recommendation |
|---|---|---|
| — | — | No issues to display |
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.
🤖 AI Security analysis: "No security issues were detected in the changed files. Residual risk remains from undetected vulnerabilities or insufficient tests; continue standard security scans and reviews."
| Risk Level | AI Score |
|---|---|
| 🟢 NO RISK | 0.0/100 |
Top 0 security issues / 0 total (Critical: 0, High: 0, Medium: 0, Low: 0)
| Title | Location | Recommendation |
|---|---|---|
| — | — | No issues to display |
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.
Pull request overview
This PR modifies the error logging behavior for the save_api_distribution_data API call to only log errors for HTTP status codes >= 400 (client and server errors) instead of any non-200 response. The change also enhances the error message to include the actual status code returned.
Key Changes:
- Changed status code check from
!= 200to>= 400to reduce noise from successful 2xx responses other than 200 - Enhanced error message to include the actual status code for better debugging
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
🤖 AI Security analysis: "No security issues were detected in the changed files. Residual risk remains from undetected vulnerabilities or insufficient tests; continue standard security scans and reviews."
| Risk Level | AI Score |
|---|---|
| 🟢 NO RISK | 0.0/100 |
Top 0 security issues / 0 total (Critical: 0, High: 0, Medium: 0, Low: 0)
| Title | Location | Recommendation |
|---|---|---|
| — | — | No issues to display |
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.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if (response.getStatusCode() >= 400 || responsePayload == null) { | ||
| logger.errorAndAddToDb( | ||
| "record_malicious_event failed: status=" | ||
| + response.getStatusCode() + "body=" + responsePayload |
Copilot
AI
Dec 8, 2025
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.
Missing space between "body=" and the responsePayload value. The concatenation should include a space for proper formatting: "body=" + responsePayload should be "body= " + responsePayload or ", body=" + responsePayload.
| + response.getStatusCode() + "body=" + responsePayload | |
| + response.getStatusCode() + " body=" + responsePayload |
...at-detection/src/main/java/com/akto/threat/detection/tasks/SendMaliciousEventsToBackend.java
Show resolved
Hide resolved
… before the body payload in error messages
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.
🤖 AI Security analysis: "No security issues were detected in the changed files. Residual risk remains from undetected vulnerabilities or insufficient tests; continue standard security scans and reviews."
| Risk Level | AI Score |
|---|---|
| 🟢 NO RISK | 0.0/100 |
Top 0 security issues / 0 total (Critical: 0, High: 0, Medium: 0, Low: 0)
| Title | Location | Recommendation |
|---|---|---|
| — | — | No issues to display |
No description provided.