Skip to content

Commit 45552a6

Browse files
committed
docs: add logging documentation to README
1 parent ae0d348 commit 45552a6

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@ jobs:
9292
max: 3 # Max retry attempts
9393
delay: 1s # Initial delay (default: 1s), exponential backoff
9494
jitter: 500ms # Optional: random variation (default: 25% of delay)
95+
log_file: output.log # Optional: file for stdout/stderr (relative to job dir)
96+
log_max_size: 10M # Optional: rotate when exceeded (default: 10M)
9597
```
9698
9799
### Runner
@@ -202,6 +204,24 @@ retry:
202204
jitter: 500ms # Optional: random variation (default: 25% of delay)
203205
```
204206

207+
### Logging
208+
209+
Capture job output to a file:
210+
211+
```yaml
212+
jobs:
213+
backup:
214+
run: ./backup.sh
215+
log_file: backup.log # Written to <job_dir>/backup.log
216+
log_max_size: 50M # Rotate when file exceeds 50MB (default: 10M)
217+
```
218+
219+
When `log_file` is set, stdout/stderr is appended to the file. Without it, output is discarded.
220+
221+
**Rotation**: When the log exceeds `log_max_size`, it's renamed to `backup.log.old` (previous `.old` is deleted).
222+
223+
**Size format**: `10M` (megabytes), `1G` (gigabytes), `512K` (kilobytes), or plain bytes.
224+
205225
### Cron Expression
206226

207227
| Field | Values |

0 commit comments

Comments
 (0)