Add API logging functionality and enhance scheduler service
Introduced ApiLog model and integrated logging for scheduled tasks in the SchedulerService. Updated server.js to include request logging middleware and new API log routes. Enhanced frontend navigation by adding a link to system logs for admin users. Adjusted session check interval in App.vue for improved performance. This update improves monitoring and debugging capabilities across the application.
This commit is contained in:
18
backend/routes/apiLogRoutes.js
Normal file
18
backend/routes/apiLogRoutes.js
Normal file
@@ -0,0 +1,18 @@
|
||||
import express from 'express';
|
||||
import apiLogController from '../controllers/apiLogController.js';
|
||||
import { authenticate } from '../middleware/authMiddleware.js';
|
||||
import { authorize } from '../middleware/authorizationMiddleware.js';
|
||||
|
||||
const router = express.Router();
|
||||
|
||||
// All routes require authentication
|
||||
router.use(authenticate);
|
||||
|
||||
// Get logs - requires permissions or admin
|
||||
router.get('/', apiLogController.getLogs);
|
||||
|
||||
// Get single log by ID
|
||||
router.get('/:id', apiLogController.getLogById);
|
||||
|
||||
export default router;
|
||||
|
||||
Reference in New Issue
Block a user