Skip to content

Conversation

@EmmanuelNiyonshuti
Copy link

Add logging

Any related issues

#6

What this does

  • Adds logging configuration in logging_config.py
  • Sets up logging on application startup via lifespan
  • Adds logging to login, logout, and registration endpoints
  • Log level can be configured via LOG_LEVEL env variable (default to INFO)

Why it's needed

Makes it easier to debug the service when it's running in production

Example logs

Successful login:

irrigation-1  | 2026-01-21T13:32:34.961Z INFO     [api.api_v1.endpoints.login:26] - Login attempt for user: user@example.com
irrigation-1  | 2026-01-21T13:32:35.047Z INFO     [api.api_v1.endpoints.login:43] - Successful login for user: user@example.com

Failed login:

irrigation-1  | 2026-01-21T13:33:59.734Z INFO     [api.api_v1.endpoints.login:26] - Login attempt for user:  user@example.com
irrigation-1  | 2026-01-21T13:33:59.737Z WARNING  [api.api_v1.endpoints.login:36] - Failed login attempt - Invalid credentials for user:  user@example.com

@prske
Copy link
Collaborator

prske commented Jan 22, 2026

Hi @EmmanuelNiyonshuti

Thank you for contributing to this project.
This seems very nice.

Currently, we are working on two features for this repository, once we finish them, we will come back to this PR.

Regards!

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.

2 participants