Skip to content

Improve logging in the API #7

@Nipa-Dev

Description

@Nipa-Dev

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!") 

Metadata

Metadata

Assignees

Labels

approvedIssue has been aprovedenhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions