feat(logging): add database logging support and refactor logging system

- Implement new database logging functionality with separate logs database
- Refactor PostLog function to store logs in database while maintaining console output
- Add new InitLogsDatabase function and related database operations
- Update main.go to support separate database paths for data and logs
- Add logging for user creation events
This commit is contained in:
2026-03-17 18:47:51 +08:00
parent 49048597f2
commit 20ec25328d
5 changed files with 91 additions and 20 deletions
+1
View File
@@ -357,6 +357,7 @@ func CreateUserHandler(w http.ResponseWriter, r *http.Request) {
"username": user.Username,
"type": user.Type,
})
postLog.Info(fmt.Sprintf("[CreateUserHandler] User \"%s\" created successfully with ID: %d", req.Username, userID))
}
func RemoveUserHandler(w http.ResponseWriter, r *http.Request) {