Skip to content

feat/database query logging#238

Merged
Userunknown84 merged 3 commits into
Userunknown84:mainfrom
Aharshi3614:feat/database_query_logging
Jun 24, 2026
Merged

feat/database query logging#238
Userunknown84 merged 3 commits into
Userunknown84:mainfrom
Aharshi3614:feat/database_query_logging

Conversation

@Aharshi3614

@Aharshi3614 Aharshi3614 commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Closes #232

Added database query logging for performance monitoring and debugging.

Changes:

  • Added mongoose debug logging for development
  • All queries logged in development mode
  • Only slow queries (>100ms) logged in production
  • Identifies which collection and query conditions

Log Output (Development):

Database query logging enabled (development)
[DB] History.find { user: '123' }
[DB] History.save { _id: '456' }
[DB] User.findOne { email: 'admin@example.com' }

Log Output (Production - Slow Queries Only):

[2026-06-24T10:00:00.000Z] Slow Query (450ms):
Collection: History
Query: {"user":"123","createdAt":{"$gt":"2026-06-01"}}

@vercel

vercel Bot commented Jun 24, 2026

Copy link
Copy Markdown

@Aharshi3614 is attempting to deploy a commit to the Aditya Sharma's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions Bot added the Hard label Jun 24, 2026
@Aharshi3614 Aharshi3614 changed the title Feat/database query logging feat/database query logging Jun 24, 2026
@Userunknown84 Userunknown84 merged commit 0d06a54 into Userunknown84:main Jun 24, 2026
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add database query logging for performance monitoring

2 participants