Add logging admin APIs for dashboard #114
This commit is contained in:
@@ -40,8 +40,6 @@ func RequireAdminAuth(handler http.HandlerFunc) http.HandlerFunc {
|
||||
return
|
||||
}
|
||||
|
||||
// Success
|
||||
log.Traceln("Authenticated request OK for", r.URL.Path, "from", r.RemoteAddr, r.UserAgent())
|
||||
handler(w, r)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,6 +71,12 @@ func Start() error {
|
||||
// Get a a detailed list of currently connected clients
|
||||
http.HandleFunc("/api/admin/clients", middleware.RequireAdminAuth(controllers.GetConnectedClients))
|
||||
|
||||
// Get all logs
|
||||
http.HandleFunc("/api/admin/logs", middleware.RequireAdminAuth(admin.GetLogs))
|
||||
|
||||
// Get warning/error logs
|
||||
http.HandleFunc("/api/admin/logs/warnings", middleware.RequireAdminAuth(admin.GetWarnings))
|
||||
|
||||
port := config.Config.GetPublicWebServerPort()
|
||||
|
||||
log.Infof("Web server running on port: %d", port)
|
||||
|
||||
Reference in New Issue
Block a user