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

Improve logging in the API #7

Open
Nipa-Dev opened this issue May 8, 2024 · 0 comments
Open

Improve logging in the API #7

Nipa-Dev opened this issue May 8, 2024 · 0 comments
Assignees
Labels
approved Issue has been aproved enhancement New feature or request

Comments

@Nipa-Dev
Copy link
Owner

Nipa-Dev commented May 8, 2024

Improve logging in lemonapi

Current logging within API is very minimal and would require improving to ensure that everything necessary is logged and with appropriate format / level. This makes tracking possible bugs and security incidents easier.

Steps

  • Authentication/Authorization area should log failed log-in attempts and when possible invalid token are used to attempt to access endpoints.
  • Exceptions should be logged in a way that they are easy to find and understand what is happening and where
  • Other endpoints should include necessary information when request is made to one.
  • Consider adding middleware to log requests.

Currently used logger for logging is loguru.
Usage is as simple as:

from loguru import logger
logger.info("This is info log!") 
@Nipa-Dev Nipa-Dev added enhancement New feature or request approved Issue has been aproved labels May 8, 2024
@Nipa-Dev Nipa-Dev self-assigned this May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Issue has been aproved enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant