diff --git a/deployment/logging.md b/deployment/logging.md index 3e400073..742fd007 100644 --- a/deployment/logging.md +++ b/deployment/logging.md @@ -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 `` directive under ``: + +```text + + + path /path/to/log_file + + +``` + +## Log Rotation Setting By default, Fluentd does not rotate log files. You can configure this behavior via system-config after v1.13.0. @@ -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: @@ -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: diff --git a/deployment/system-config.md b/deployment/system-config.md index 2ac7dce0..e014f5d1 100644 --- a/deployment/system-config.md +++ b/deployment/system-config.md @@ -174,6 +174,16 @@ Enable JIT for worker processes. Internally, this configuration enables Ruby's ` ### `` 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 |