-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
Description
Logging is inconsistent across the application. Some log messages are unhelpful, and log levels are not always used appropriately.
Examples:
- Unhelpful message: In
AuthController.checkUsername, the loglog.error("username {} not found for some weird reason", username);is not professional or helpful for debugging. It should be alog.warnorlog.infostating the username was checked and not found. - Inconsistent Levels: Some debug-level information is logged at
INFO(e.g., inChatWebSocketHandler). - Missing Logs: Critical paths, like the
defaultcase inChatWebSocketHandler.handleTextMessage, log a warning but could be more verbose about the payload received.
Acceptance Criteria
- Audit all log statements in the project.
- Standardize log levels:
ERROR: For unrecoverable errors (e.g., database connection failure, unhandled exceptions inControllerAdvice).WARN: For recoverable issues or potential problems (e.g., invalid auth token, user not found, unhandled WebSocket message type).INFO: For major lifecycle events (e.g., application started, user logged in, new user registered, session connected/disconnected).DEBUG: For granular, high-volume information (e.g., "message received", "checking cache", "sending token request").
- Rewrite unhelpful messages: Change messages like "...for some weird reason" to be professional and state the facts.
- Ensure all exceptions are logged with the stack trace at the
ERRORorWARNlevel.