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 log log.error("username {} not found for some weird reason", username); is not professional or helpful for debugging. It should be a log.warn or log.info stating the username was checked and not found.
- Inconsistent Levels: Some debug-level information is logged at
INFO (e.g., in ChatWebSocketHandler).
- Missing Logs: Critical paths, like the
default case in ChatWebSocketHandler.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 in ControllerAdvice).
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
ERROR or WARN level.
Description
Logging is inconsistent across the application. Some log messages are unhelpful, and log levels are not always used appropriately.
Examples:
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.INFO(e.g., inChatWebSocketHandler).defaultcase inChatWebSocketHandler.handleTextMessage, log a warning but could be more verbose about the payload received.Acceptance Criteria
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").ERRORorWARNlevel.