🚀 OutputLog mirrors command output to both stdout and timestamped log files
🚀 OutputLog mirrors command output to both stdout and timestamped log files
Use for quickly recording troubleshooting activities, and system administration tasks:
- (📤) Mirror standard output in real-time using shell pipes
- (📁) Automatically create and manage log directories
- (⏰) Automatically add timezone-aware timestamps to log filenames
- (⏱️) Set timeout thresholds for long-running commands
- (🔍) Enable verbose mode to track capture start/end times and file locations
<COMMAND> | ol [flags]-e, --extension: string log filename extension (override with shell-env OUTPUTLOG_EXTENSION) (default ".txt")
-h, --help: help for ol
-d, --path: string destination directory (override with shell-env OUTPUTLOG_PATH) (default "$HOME/outputlog")
-p, --prefix: string log filename prefix (override with shell-env OUTPUTLOG_PREFIX) (default "command-output")
-t, --timeout: duration duration to wait for input before exiting (e.g. 30s, 1m) (override with shell-env OUTPUTLOG_TIMEOUT) (default 1m0s)
-v, --verbose: enable verbose logging to stderr (override with shell-env OUTPUTLOG_VERBOSE)
--version: version for ol
- Quick capture with default settings:
my-deployment-script | ol
# Logs to: ~/outputlog/command-output-<timestamp>.txt- Custom log location and filename pattern:
kubectl get pods -A | ol --path ./kube-logs --prefix pods --extension .txt
# Logs to: ./kube-logs/pods-<timestamp>.txt- Configure via environment variables:
export OUTPUTLOG_PATH=/var/log/jobs
export OUTPUTLOG_PREFIX=backup
export OUTPUTLOG_TIMEOUT=5m
backup-script | ol --verbose
# Logs to: /var/log/jobs/backup-<timestamp>.txt with verbose outputContributions are welcome! Help us improve by submitting issues, feature requests, or pull requests.
This repository is provided "as is" without any warranties. The author is not responsible for any damages or issues arising from its use. Additionally, this project is not affiliated with or endorsed by any organization or entity. Use at your own risk.
OutputLog is licensed under the Apache-2.0 License.
🌟 If you find this project useful, consider giving it a star! ⭐