A command-line utility for extracting and filtering logs from applications hosted on Scalingo around a specific timestamp.
- Extract all logs (recent and archived) around a specific timestamp
- Define the quantity of logs to extract either by line count or hours
- Support for multiple environments (production, staging, development) and regions
- Interactive survey or inline mode with command-line flags
- Flexible timestamp input formats
- Sorted and filtered results for easier troubleshooting
- Go 1.23 or higher
- Scalingo CLI configured and authenticated
- Access to one application hosted on Scalingo
The tool can be used in interactive mode or with command-line flags.
# Run in interactive mode
scalilogs
# Run with command-line flags (filtering by lines around timestamp)
scalilogs -a app-name -t "2023-06-15 14:30:00" -l 100
# Run with command-line flags (filtering by hours around timestamp)
scalilogs -a app-name -t "2023-06-15 14:30:00" -h 2
# Run with a specific region
scalilogs -a app-name -t "2023-06-15 14:30:00" -l 100 -r osc-secnum-fr1
# Run with a specific environment
scalilogs -a app-name -t "2023-06-15 14:30:00" -l 100 -e staging
# Long-form flags with environment and region
scalilogs --app my-app --timestamp "2023-06-15 14:30:00" --hours 3 --env production --region osc-fr1
# With relative timestamp (will be validated and normalized)
scalilogs -a my-app -t "Today at 14:30:00" -l 100When run without flags, the tool will guide you through the log extraction process with prompts for:
- Application name
- Environment selection (Production, Staging, Development)
- Region selection (fetched dynamically from the Scalingo API)
- Timestamp (with flexible format support)
- Filtering method (line count or hours)
- Number of lines or hours to show before and after the timestamp
The tool supports various timestamp formats:
-
Absolute date:
2023-06-15 14:30:002023/06/15 14:30:002023/06/15 14:3015/06/2023 14:30:00(DD/MM/YYYY)06/15/2023 14:30:00(MM/DD/YYYY)2023-06-15T14:30:00(ISO 8601)2023-06-15 14:30
-
With 'at':
2025-03-22 at 12:00:002025-03-22 at 12:002025-03-22 at 12
-
Relative day:
now(current date and time)today(defaults to noon today)today at 14:30yesterday(defaults to noon yesterday)yesterday at 14:30
-
Weekday:
monday(defaults to noon on the most recent Monday)monday at 14:30
-
Time-only (defaults to today):
14(interpreted as today at 14:00:00)
All formats are automatically normalized to the standard YYYY-MM-DD HH:MM:SS format.
# Install directly using Go
go install github.com/briceamen/scalilogs@latest
# Or build from source:
# Clone the repository
git clone https://github.com/briceamen/scalilogs.git
cd scalilogs
# Build only
make
# Build and install to your Go bin path
make installLogs are extracted to a temporary directory ($TMPDIR/scalingo-logs/) with a timestamped filename. The tool will display the path to the output file when finished.
The tool supports three environments:
- production: The default environment for production applications (default)
- staging: For applications in the staging environment
- dev: For development/local environment
Each environment uses different authentication endpoints and API URLs. When using the interactive mode, you'll be prompted to select an environment. For command-line usage, you can specify the environment with the -e or --env flag.