feat: Add Pino structured logging, release-please CI/CD and Docker pipeline
Replace all console.log/error with Pino logger (info/warn/error/debug/fatal) for structured JSON logging in production and pretty-print in development. Remove redundant header dumps and consolidate rate-limit logging. Add GitHub Actions workflow with release-please for automated semver releases and Docker build/push to GHCR on new releases.
This commit is contained in:
@@ -5,6 +5,7 @@ const { initializeDatabase, checkAndPopulateDatabase } = require('./src/db');
|
||||
const playerRoutes = require('./src/routes/players');
|
||||
const courseRoutes = require('./src/routes/courses');
|
||||
const pageRoutes = require('./src/routes/pages');
|
||||
const logger = require('./src/logger');
|
||||
|
||||
const app = express();
|
||||
const PORT = 3000;
|
||||
@@ -22,9 +23,9 @@ initializeDatabase().then(async () => {
|
||||
await checkAndPopulateDatabase();
|
||||
|
||||
app.listen(PORT, () => {
|
||||
console.log(`PDGA Ratings app running on http://localhost:${PORT}`);
|
||||
logger.info(`PDGA Ratings app running on http://localhost:${PORT}`);
|
||||
});
|
||||
}).catch(err => {
|
||||
console.error('Failed to initialize database:', err);
|
||||
logger.fatal('Failed to initialize database:', err);
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user