Add comprehensive logging for backend and frontend#4
Draft
Conversation
- Backend: Add request/response logging middleware - Backend: Enhance all route handlers with detailed user action and error logging - Frontend: Create logger utility with structured logging - Frontend: Add HTTP request/response interceptors with logging - Frontend: Add user action logging in code generator - Frontend: Add navigation logging to router - Frontend: Add global error handlers with logging Co-authored-by: anguera5 <71595117+anguera5@users.noreply.github.com>
- Create LOGGING.md with detailed guide on logging implementation - Update README.md with logging references - Document backend and frontend logging architecture - Include examples, best practices, and troubleshooting tips Co-authored-by: anguera5 <71595117+anguera5@users.noreply.github.com>
- Add backend test_logging.py script to demonstrate backend logging - Add frontend test-logging.html page to demonstrate frontend logging - Provide interactive way to test logging functionality Co-authored-by: anguera5 <71595117+anguera5@users.noreply.github.com>
- Create LOGGING_EXAMPLES.md with real-world log examples - Show backend and frontend log formats - Demonstrate error handling and user journey tracking - Include log analysis examples and performance insights Co-authored-by: anguera5 <71595117+anguera5@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add logging functionality for backend and frontend
Add comprehensive logging for backend and frontend
Nov 13, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements request/response logging middleware on backend and structured logger utility on frontend to track user actions, API calls, navigation, and errors throughout the application.
Backend Changes
[USER_ACTION],[SUCCESS],[ERROR]categorized logging across all 11 endpointsYYYY-MM-DDTHH:MM:SSZ LEVEL MODULE MESSAGEwith daily rotation (14 days retention)/var/log/genai-portfolio/app.logExample output:
Frontend Changes
src/lib/logger.ts): Structured logger with levels (DEBUG, INFO, WARN, ERROR), in-memory buffer (1000 logs), color-coded console outputsrc/lib/http.ts): Auto-logs all API requests/responses with duration tracking and API key redactionExample output:
Documentation
LOGGING.md: Architecture, log categories, filtering examples, best practicesLOGGING_EXAMPLES.md: Real-world log samples and analysis patternsbackend/test_logging.pyandfrontend/test-logging.htmlfor interactive testingSecurity
API keys automatically redacted in frontend logs. Only metadata (lengths, counts) logged, not user content.
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.