Skip to content

Commit f1e7b55

Browse files
Watson1978daipom
andauthored
system_config: add path attribute in system/log section (#516)
Signed-off-by: Shizuo Fujita <[email protected]> Co-authored-by: Daijiro Fukuda <[email protected]>
1 parent a7a42eb commit f1e7b55

File tree

2 files changed

+27
-3
lines changed

2 files changed

+27
-3
lines changed

deployment/logging.md

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,13 +148,27 @@ end
148148

149149
## Output to Log File
150150

151+
### By Command Line Option
152+
151153
By default, Fluentd outputs to the standard output. Use `-o` command line option to specify the file instead:
152154

153155
```text
154156
$ fluentd -o /path/to/log_file
155157
```
156158

157-
### Log Rotation Setting
159+
### By Config File
160+
161+
Since v1.18.0, You can also configure the log file path using the `<log>` directive under `<system>`:
162+
163+
```text
164+
<system>
165+
<log>
166+
path /path/to/log_file
167+
</log>
168+
</system>
169+
```
170+
171+
## Log Rotation Setting
158172

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

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

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

179-
#### `--log-rotate-age AGE`
193+
### `--log-rotate-age AGE`
180194

181195
`AGE` is an integer or a string:
182196

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

186200
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.
187201

188-
#### `--log-rotate-size BYTES`
202+
### `--log-rotate-size BYTES`
189203

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

deployment/system-config.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,16 @@ Enable JIT for worker processes. Internally, this configuration enables Ruby's `
174174

175175
### `<log>` section
176176

177+
#### `path`
178+
179+
| type | default | version |
180+
| :--- | :--- | :--- |
181+
| string | nil | 1.18.0 |
182+
183+
Specifies the log file path.
184+
185+
Please see also [Output to Log File](logging.md#output-to-log-file).
186+
177187
#### `format`
178188

179189
| type | default | version |

0 commit comments

Comments
 (0)