For Vibecoders & AI Assistants
Complete Logstack integration guide optimized for AI-assisted development. Copy this entire page for your AI assistant.
Logstack for Vibecoders 🤖
This page contains everything an AI assistant needs to help you integrate Logstack into your project. Copy the entire snippet below and paste it into your AI assistant's context.
This documentation is specifically designed to be AI-readable. Share the snippet below with your favorite AI coding assistant (Copilot, Cursor, Claude, etc.) for seamless integration.
Complete AI-Friendly Integration Snippet
Copy everything inside the code block below and paste it into your AI assistant:
Requirements
- Node.js 16.0.0 or higher
- TypeScript 4.7+ (optional but recommended)
- A Logstack API key (get one at logstack.tech/signup)
Environment Variables
Create a .env file with:
Basic Usage
Development vs Production Mode
-
Development mode (
NODE_ENV=development):- Logs output to console only with colored formatting
- No network requests, no server logging
- Great for local development
-
Production mode (
NODE_ENV=production):- Logs sent to Logstack server
- Stored in database, triggers alerts
- Push notifications for errors/critical
Log Entry Structure
Setting Persistent Context
Framework Integration Examples
Express.js Middleware
Next.js Integration
NestJS Integration
REST API Reference
Ingest Logs
Query Logs
Common Patterns
Error Boundary Logging (React)
Async Operation Logging
Troubleshooting
-
Logs not appearing in dashboard?
- Check NODE_ENV is set to 'production'
- Verify API key is correct
- Ensure flush() or close() is called before exit
-
Console logs not colored?
- Only works in terminal environments
- Browser logs use CSS styling instead
-
Getting rate limited?
- Increase batchSize to reduce API calls
- Check if you're logging in a tight loop
Links
- Dashboard: https://logstack.tech/dashboard
- API Docs: https://logstack.tech/docs/api/overview
- Self-Hosting: https://logstack.tech/docs/deployment/overview
- GitHub: https://github.com/logstack/logstack
- Support: support@logstack.tech