Skip to content
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

Darren/chore/admin req logger #857

Conversation

darrenvechain
Copy link
Member

@darrenvechain darrenvechain commented Oct 1, 2024

Description

allow dynamic change of API request logging:

image
  1. Start thor solo:
make thor; ./bin/thor solo --enable-admin
  1. Get the current setting:
curl http://127.0.0.1:2113/admin/apilogs
# {"enabled":false}
  1. Enable Logs:
curl http://127.0.0.1:2113/admin/apilogs -X POST -d '{"enabled":true}' # false to disable the logs

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • New and existing E2E tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have not added any vulnerable dependencies to my code

@darrenvechain darrenvechain requested a review from a team as a code owner October 1, 2024 12:38
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 40.20619% with 58 lines in your changes missing coverage. Please review.

Project coverage is 62.59%. Comparing base (e8d420d) to head (e62e09e).

Files with missing lines Patch % Lines
api/admin.go 48.71% 39 Missing and 1 partial ⚠️
cmd/thor/main.go 0.00% 14 Missing ⚠️
api/request_logger.go 25.00% 2 Missing and 1 partial ⚠️
api/api.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #857      +/-   ##
==========================================
- Coverage   62.66%   62.59%   -0.07%     
==========================================
  Files         208      207       -1     
  Lines       18926    18956      +30     
==========================================
+ Hits        11860    11866       +6     
- Misses       5968     5991      +23     
- Partials     1098     1099       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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

Successfully merging this pull request may close these issues.

3 participants