Skip to content

Commit

Permalink
Make logging clearer
Browse files Browse the repository at this point in the history
  • Loading branch information
dadgar committed Apr 11, 2017
1 parent ef28b79 commit c005d29
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion website/source/docs/job-specification/logs.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ parameters section below), and there is currently no way to disable logging for
tasks. The `logs` stanza allows for finer-grained control over how Nomad handles
log files.

Nomad's log rotation works by writing stdout/stderr output from tasks to a file
inside the `alloc/logs/` directory with the following format:
`<task-name>.<stdout/stderr>.<index>`. Output is written to a particular index,
starting at zero, till that log file hits the configured `max_file_size`. After,
a new file is created at `index + 1` and logs will then be written there. A log
file is never rolled over, instead Nomad will keep up to `max_files` worth of
logs and once that is exceeded, the log file with the lowest index is deleted.

```hcl
job "docs" {
group "example" {
Expand All @@ -38,7 +46,8 @@ job "docs" {
}
```

For information on how to interact with logs after they have been configured, please see the [`nomad logs`][logs-command] command.
For information on how to interact with logs after they have been configured,
please see the [`nomad logs`][logs-command] command.

## `logs` Parameters

Expand Down

0 comments on commit c005d29

Please sign in to comment.