From 75a4843076314de75ec5ddc5921543822cd05445 Mon Sep 17 00:00:00 2001 From: meenu155 Date: Wed, 5 Nov 2025 19:38:50 +0530 Subject: [PATCH 1/6] feat(logging): Implement comprehensive logging feature across services - Added logging initialization in scaffold.js for new services. - Updated documentation to include a new "Service Logs" feature section. - Created logs-feature.md detailing CLI and web-based log viewing capabilities. - Enhanced Go service with structured logging and log retrieval endpoint. - Integrated logging functionality in Node.js service with middleware for request logging. - Implemented logging in Python FastAPI service with file-based logging. - Added logging capabilities in Spring Boot service with structured log entries. --- bin/index.js | 22 + bin/lib/admin.js | 414 ++++++++++++- bin/lib/logs.js | 570 ++++++++++++++++++ bin/lib/scaffold.js | 9 + docs/.vitepress/config.mjs | 6 +- docs/logs-feature.md | 218 +++++++ templates/go/main.go | 200 +++++- templates/node/src/index.js | 117 ++++ templates/python/app/main.py | 148 ++++- .../java/com/example/DemoApplication.java | 146 ++++- .../target/classes/application.properties.txt | 1 - .../classes/com/example/DemoApplication.class | Bin 1230 -> 0 bytes 12 files changed, 1835 insertions(+), 16 deletions(-) create mode 100644 bin/lib/logs.js create mode 100644 docs/logs-feature.md delete mode 100644 templates/spring-boot/target/classes/application.properties.txt delete mode 100644 templates/spring-boot/target/classes/com/example/DemoApplication.class diff --git a/bin/index.js b/bin/index.js index ec252a0..2ce376e 100755 --- a/bin/index.js +++ b/bin/index.js @@ -9,6 +9,7 @@ import { renderServicesTable } from './lib/ui.js'; import { runDev } from './lib/dev.js'; import { startAdminDashboard } from './lib/admin.js'; import { runHotReload } from './lib/hotreload.js'; +import { viewLogs } from './lib/logs.js'; const program = new Command(); @@ -177,6 +178,27 @@ program process.exit(1); } }); + +// Service logs viewer and management +program + .command('logs') + .description('View and manage service logs') + .argument('[service]', 'Specific service name (optional, shows all services if omitted)') + .option('-f, --follow', 'Follow log output in real-time') + .option('-t, --tail ', 'Number of recent lines to show (default: 50)', '50') + .option('--since