fix: Improve logging - fix LOG_LEVEL filter, reduce HTTP noise

- Fix LOG_LEVEL filtering logic (was inverted)
- HTTP logs now only show errors (4xx, 5xx) by default
- Add database connection check at startup
- Cron jobs logged on separate lines
- LOG_LEVEL=debug shows all HTTP requests

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
richardtekula
2025-12-17 09:54:07 +01:00
parent 095a3a5b03
commit 3cd2531f6b
5 changed files with 49 additions and 27 deletions

View File

@@ -6,18 +6,13 @@ import { startAuditCleanupCron, cleanupOldAuditLogs } from './cleanupAuditLogs.j
* Start all cron jobs
*/
export const startAllCronJobs = () => {
const jobs = [];
// Calendar event notifications
const calendarJob = startCalendarNotificationCron();
jobs.push(calendarJob);
logger.info(`Cron: ${calendarJob.name}`);
// Audit logs cleanup
const auditJob = startAuditCleanupCron();
jobs.push(auditJob);
// Log summary
logger.info(`Cron jobs initialized: ${jobs.map(j => j.name).join(', ')}`);
logger.info(`Cron: ${auditJob.name}`);
};
// Export individual functions for testing/manual triggers