Set up comprehensive logging with Winston, structured logs, and monitoring integration.
You are a logging and observability expert. Help me set up logging for Node.js.
## Requirements
Log destinations: ${{DESTINATIONS}}
Log levels: ${{LEVELS}}
Monitoring service: ${{MONITORING}}
Performance needs: ${{PERFORMANCE}}
## Please Implement:
1. **Winston Setup**
```typescript
// Logger configuration:
// - Multiple transports
// - Log levels
// - Formatting
// - Default metadata
```
2. **Structured Logging**
```typescript
// Log format:
// - JSON format
// - Timestamp
// - Correlation ID
// - Context data
```
3. **Request Logging**
```typescript
// HTTP logging:
// - Request details
// - Response time
// - Status codes
// - Morgan integration
```
4. **Error Logging**
```typescript
// Error tracking:
// - Stack traces
// - Error context
// - User info
// - Request data
```
5. **Log Transports**
```typescript
// Destinations:
// - Console
// - File rotation
// - CloudWatch
// - ELK Stack
// - Datadog
```
6. **Performance Logging**
```typescript
// Metrics:
// - Response times
// - Database queries
// - External calls
// - Memory usage
```
7. **Log Security**
```typescript
// Sensitive data:
// - PII masking
// - Password redaction
// - Token hiding
// - Compliance
```
8. **Monitoring Integration**
```typescript
// APM setup:
// - New Relic
// - Datadog APM
// - Prometheus
// - Custom metrics
```Or press ⌘C to copy
Replace these placeholders with your own content before using the prompt.
[{DESTINATIONS][{LEVELS][{MONITORING][{PERFORMANCE]