Skip to content

Commit

Permalink
system_config: add path attribute in system/log section (#516)
Browse files Browse the repository at this point in the history
Signed-off-by: Shizuo Fujita <[email protected]>
Co-authored-by: Daijiro Fukuda <[email protected]>
  • Loading branch information
Watson1978 and daipom authored Dec 2, 2024
1 parent a7a42eb commit f1e7b55
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 3 deletions.
20 changes: 17 additions & 3 deletions deployment/logging.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,13 +148,27 @@ end

## Output to Log File

### By Command Line Option

By default, Fluentd outputs to the standard output. Use `-o` command line option to specify the file instead:

```text
$ fluentd -o /path/to/log_file
```

### Log Rotation Setting
### By Config File

Since v1.18.0, You can also configure the log file path using the `<log>` directive under `<system>`:

```text
<system>
<log>
path /path/to/log_file
</log>
</system>
```

## Log Rotation Setting

By default, Fluentd does not rotate log files. You can configure this behavior via system-config after v1.13.0.

Expand All @@ -176,7 +190,7 @@ Actually, an external library manages these default values, resulting in this co

You can use command-line options too (mainly for before v1.13.0):

#### `--log-rotate-age AGE`
### `--log-rotate-age AGE`

`AGE` is an integer or a string:

Expand All @@ -185,7 +199,7 @@ You can use command-line options too (mainly for before v1.13.0):

NOTE: When `--log-rotate-age` is specified on Windows, log files are separated into `log-supervisor-0.log`, `log-0.log`, ..., `log-N.log` where `N` is `generation - 1` due to the system limitation. Windows does not permit delete and rename files simultaneously owned by another process.

#### `--log-rotate-size BYTES`
### `--log-rotate-size BYTES`

The byte size to rotate log files. This is applied when `--log-rotate-age` is specified with integer:

Expand Down
10 changes: 10 additions & 0 deletions deployment/system-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,16 @@ Enable JIT for worker processes. Internally, this configuration enables Ruby's `

### `<log>` section

#### `path`

| type | default | version |
| :--- | :--- | :--- |
| string | nil | 1.18.0 |

Specifies the log file path.

Please see also [Output to Log File](logging.md#output-to-log-file).

#### `format`

| type | default | version |
Expand Down

0 comments on commit f1e7b55

Please sign in to comment.