Logging
Introduction
Section titled “Introduction”Connect emits rich, structured logs so you can follow every transfer. Messages appear on the console in interactive mode and can be redirected or formatted for automation.
Operating modes
Section titled “Operating modes”- Interactive mode (default) paints progress bars and compact summaries for humans.
- Batch mode (
--batch) switches to line-by-line logs that are easy to tail or capture in files.
Connect will automatically fall back to batch mode when it cannot allocate an interactive console (for example, when stdout is not a TTY).
Interactive example
Section titled “Interactive example”[file1.zip] 1.00 MiB / 1.00 MiB done[file2.zip] 1.00 MiB / 1.00 MiB doneProgress Bars
Section titled “Progress Bars”When running in interactive mode (the default), Connect displays helpful progress bars that allow you to monitor the status of your data transfers in real-time. These visual indicators provide immediate feedback on transfer progress.
What Progress Bars Show
Section titled “What Progress Bars Show”Each progress bar displays the following information for active transfers:
- File name — The name of the file being transferred
- Bytes transferred — Current progress shown as
transferred / total(e.g.,1.00 MiB / 5.00 MiB) - Transfer rate — Current speed of the transfer (e.g.,
4.5 MB/s) - Estimated time remaining — Time until completion (e.g.,
ETA: 00:12) - Percentage complete — Visual progress indicator
Progress Bar Example
Section titled “Progress Bar Example”[file1.zip] ████████████████████░░░░░░░░ 64% | 3.20 MiB / 5.00 MiB | 4.2 MB/s | ETA: 00:07[file2.zip] ████████████████████████████ 100% | 2.50 MiB / 2.50 MiB | 5.1 MB/s | done[file3.zip] ░░░░░░░░░░░░░░░░░░░░░░░░░░░ 0% | 0.00 MiB / 3.00 MiB | waiting...Parallel Transfers
Section titled “Parallel Transfers”When using parallel uploads, multiple progress bars are displayed simultaneously, one for each active transfer. This allows you to monitor the status of all concurrent operations at a glance.
Progress Bar Behavior
Section titled “Progress Bar Behavior”- Progress bars update in real-time as data is transferred
- Completed transfers show a “done” status and remain briefly for confirmation
- The display automatically adjusts based on terminal width
- Progress bars are only shown in interactive mode (TTY output)
- In batch mode or when stdout is redirected, progress bars are replaced with log entries
Customization
Section titled “Customization”You can control progress bar display through the following flags:
--batch— Disables progress bars and uses line-by-line logging instead--quiet— Suppresses all output including progress bars (use with--batchfor exit code only)--no-color— Removes color formatting from progress bars and other output
Batch example
Section titled “Batch example”$ connect move --batch --no-color \ ~/payloads/*.zip \ sftp://monitor01:[email protected]/incoming/2025/06/27 13:03:24 INFO Discovering sources pattern="/home/ops/payloads/*.zip" matches=22025/06/27 13:03:25 INFO Transferring file=file1.zip sftpSessionID=12025/06/27 13:03:25 INFO File transferred successfully bytesTransferred=1048576 duration=153ms transferRate=6.52MB/s file=file1.zip sftpSessionID=12025/06/27 13:03:25 INFO Transferring file=file2.zip sftpSessionID=12025/06/27 13:03:25 INFO File transferred successfully bytesTransferred=1048576 duration=60ms transferRate=16.62MB/s file=file2.zip sftpSessionID=1Log levels
Section titled “Log levels”- INFO — expected activity (discovery, transfers, cleanup).
- WARN — something noteworthy but non-fatal (e.g., no files matched).
- ERROR — an operation failed and Connect exited with a non-zero status.
2025/06/27 11:35:34 INFO Listing sftp://[email protected]/incoming/ pattern="regex:^report.*\\.csv$"2025/06/27 11:35:35 WARN No entries matched filter pattern2025/06/27 11:36:22 ERROR Failed to open SFTP session error=ssh: unable to authenticate, attempted methods [none password], no supported methods remainOutput formats
Section titled “Output formats”Specify --log-format json to emit structured JSON.
$ connect move --batch --log-format json ~/payloads/*.zip sftp://monitor01:[email protected]/incoming/{"time":"2025-06-27T13:13:42.929477+02:00","level":"INFO","msg":"Moving files","destination":"sftp://[email protected]/incoming/"}{"time":"2025-06-27T13:13:45.219012+02:00","level":"INFO","msg":"Transferring","file":"file1.zip"}{"time":"2025-06-27T13:13:45.452400+02:00","level":"INFO","msg":"File transferred successfully","file":"file1.zip","bytesTransferred":1048576,"duration":"207ms","transferRate":"4.81MB/s"}Redirecting logs
Section titled “Redirecting logs”Batch output is plain text, so redirect with >> or pipe into another tool.
$ connect move --batch --no-color ~/payloads/*.zip sftp://monitor01:[email protected]/incoming/ >> /var/log/connect/job1.log$ tail -n3 /var/log/connect/job1.log2025/06/29 08:48:26 INFO File transferred successfully bytesTransferred=1048576 duration=61ms transferRate=16.39MB/s file=file2.zip sftpSessionID=12025/06/29 08:48:26 INFO Remove source path=/home/ops/payloads/file2.zip2025/06/29 08:48:26 INFO Move completeQuiet mode
Section titled “Quiet mode”Use --quiet --batch when you only care about the exit code (0 on success).
$ echo $?0