Files
TimeTracker/logrotate.conf.example
Dries Peeters e4789cc26e feat: Add telemetry and analytics infrastructure with observability stack
Implement comprehensive analytics and monitoring system with PostHog integration,
complete observability stack (Prometheus, Grafana, Loki, Promtail), and CI/CD
workflows for automated builds.

Features:
- Add PostHog telemetry integration with privacy-focused event tracking
- Implement installation flow for opt-in telemetry configuration
- Add telemetry management UI in admin panel with detailed transparency
- Track key user events across all major features (projects, tasks, timer, etc.)

Infrastructure:
- Set up Prometheus for metrics collection
- Configure Grafana for visualization dashboards
- Integrate Loki and Promtail for log aggregation
- Add separate analytics docker-compose configuration

CI/CD:
- Add GitHub Actions workflows for building and publishing Docker images
- Implement separate dev and production build pipelines
- Configure automated image publishing to registry

Documentation:
- Restructure documentation into organized docs/ directory
- Add comprehensive guides for telemetry, analytics, and local development
- Create transparency documentation for tracked events
- Add CI/CD and build configuration guides

Code improvements:
- Integrate telemetry hooks across all route handlers
- Add feature flags and configuration management
- Refactor test suite for analytics functionality
- Clean up root directory by moving docs and removing test artifacts

Breaking changes:
- Requires new environment variables for PostHog configuration
- Docker compose setup now supports analytics stack

Changes: 73 files changed, 955 insertions(+), 14126 deletions(-)
2025-10-20 14:38:57 +02:00

103 lines
2.4 KiB
Plaintext

# Logrotate configuration for TimeTracker logs
#
# Installation on Linux:
# 1. Copy this file to /etc/logrotate.d/timetracker
# 2. Adjust the path to match your installation
# 3. Test: sudo logrotate -d /etc/logrotate.d/timetracker
# 4. Force rotation: sudo logrotate -f /etc/logrotate.d/timetracker
#
# For Docker deployments:
# - Mount logs directory: -v ./logs:/app/logs
# - This config applies to the host logs directory
/path/to/TimeTracker/logs/*.jsonl {
# Rotate daily
daily
# Keep 7 days of logs
rotate 7
# Compress old logs
compress
# Delay compression until next rotation
delaycompress
# Don't error if log file is missing
missingok
# Don't rotate if log is empty
notifempty
# Copy and truncate instead of moving (allows app to keep writing)
copytruncate
# Set permissions on rotated logs
create 0640 root root
# Maximum age of logs (30 days)
maxage 30
# Rotate if larger than 100MB
size 100M
# Shared scripts section for all log files
sharedscripts
# Optional: Run a command after rotation
postrotate
# Example: Send logs to long-term storage
# aws s3 sync /path/to/TimeTracker/logs/ s3://your-bucket/logs/
# Example: Clear old archives
# find /path/to/TimeTracker/logs/ -name "*.gz" -mtime +90 -delete
endscript
}
# Separate config for standard logs
/path/to/TimeTracker/logs/timetracker.log {
daily
rotate 14
compress
delaycompress
missingok
notifempty
copytruncate
create 0640 root root
}
# Configuration for error logs (if separate)
/path/to/TimeTracker/logs/error.log {
# Rotate more frequently for error logs
daily
rotate 30
compress
delaycompress
missingok
notifempty
copytruncate
create 0640 root root
# Alert if error log is too large
size 50M
postrotate
# Optional: Send alert if error log is rotated frequently
# echo "TimeTracker error log rotated" | mail -s "Error log alert" admin@example.com
endscript
}
# Alternative: More aggressive rotation for high-traffic installations
# /path/to/TimeTracker/logs/*.jsonl {
# hourly
# rotate 168 # Keep 1 week of hourly logs
# compress
# delaycompress
# missingok
# notifempty
# copytruncate
# dateext
# dateformat -%Y%m%d-%H
# }