Skip to content

Commit 8806e20

Browse files
committed
merge error
1 parent 21920c3 commit 8806e20

6 files changed

+137
-1
lines changed

logging/efk-logging-fluentd.adoc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,14 @@ toc::[]
1313
// assemblies.
1414

1515

16+
include::modules/efk-logging-fluentd-pod-location.adoc[leveloffset=+1]
17+
18+
include::modules/efk-logging-fluentd-log-viewing.adoc[leveloffset=+1]
19+
20+
include::modules/efk-logging-fluentd-log-location.adoc[leveloffset=+1]
21+
22+
include::modules/efk-logging-fluentd-log-rotation.adoc[leveloffset=+1]
23+
1624
include::modules/efk-logging-external-fluentd.adoc[leveloffset=+1]
1725

1826
include::modules/efk-logging-fluentd-connections.adoc[leveloffset=+1]
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * logging/efk-logging-fluentd.adoc
4+
5+
[id='efk-logging-fluentd-log-location_{context}']
6+
= Configuring Fluentd log location
7+
8+
Fluentd writes logs to a specified file, by default `/var/log/fluentd/fluentd.log`, or to the console, based on the `LOGGING_FILE_PATH` environment variable.
9+
10+
.Procedure
11+
12+
To set the output location for the Fluentd logs:
13+
14+
. Edit the `LOGGING_FILE_PATH` parameter
15+
in the default inventory file. You can specify a particular file or to STDOUT:
16+
+
17+
----
18+
LOGGING_FILE_PATH=console <1>
19+
LOGGING_FILE_PATH=<path-to-log/fluentd.log> <2>
20+
----
21+
<1> Sends the log output to STDOUT.
22+
<2> Sends the log output to the specified file.
23+
24+
. Re-run the logging installer playbook:
25+
+
26+
----
27+
$ cd /usr/share/ansible/openshift-ansible
28+
$ ansible-playbook [-i </path/to/inventory>] \
29+
playbooks/openshift-logging/config.yml
30+
----
31+
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * logging/efk-logging-fluentd.adoc
4+
5+
[id='efk-logging-fluentd-log-rotation_{context}']
6+
= Configuring Fluentd log rotation
7+
8+
When the current Fluentd log file reaches a specified size, {product-title} automatically renames the *fluentd.log* log file so that new logging data can be collected.
9+
Log rotation is enabled by default.
10+
11+
The following example shows logs in a cluster where the maximum log size is 1Mb and four logs should be retained. When the *fluentd.log* reaches 1Mb, {product-title}
12+
deletes the current *fluentd.log.4*, renames the each of the Fluentd logs in turn, and creates a new *fluentd.log*.
13+
14+
----
15+
fluentd.log 0b
16+
fluentd.log.1 1Mb
17+
fluentd.log.2 1Mb
18+
fluentd.log.3 1Mb
19+
fluentd.log.4 1Mb
20+
----
21+
22+
.Procedure
23+
24+
You can control the size of the Fluentd log files and how many of the renamed files that {product-title} retains using
25+
environment variables.
26+
27+
.Parameters for configuring Fluentd log rotation
28+
[cols="3,7",options="header"]
29+
|===
30+
|Parameter
31+
|Description
32+
33+
| `LOGGING_FILE_SIZE` | The maximum size of a single Fluentd log file in Bytes. If the size of the *flientd.log* file exceeds this value, {product-title} renames the *fluentd.log.** files and creates a new *fluentd.log*. The default is 1024000 (1MB).
34+
| `LOGGING_FILE_AGE` | The number of logs that Fluentd retains before deleting. The default value is `10`.
35+
|===
36+
37+
For example:
38+
39+
----
40+
$ oc set env ds/logging-fluentd LOGGING_FILE_AGE=30 LOGGING_FILE_SIZE=1024000"
41+
----
42+
43+
Turn off log rotation by setting `LOGGING_FILE_PATH=console`.
44+
This causes Fluentd to write logs to STDOUT where they can be retrieved using the `oc logs -f <pod_name>` command.
45+
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * logging/efk-logging-fluentd.adoc
4+
5+
[id='efk-logging-fluentd-viewing_{context}']
6+
= Viewing Fluentd logs
7+
8+
How you view logs depends upon the `LOGGING_FILE_PATH` setting.
9+
10+
* If `LOGGING_FILE_PATH` points to a file, use the *logs* utility to print out the contents of Fluentd log files:
11+
+
12+
----
13+
oc exec <pod> logs <1>
14+
----
15+
<1> Specify the name of the Fluentd pod.
16+
+
17+
For example:
18+
+
19+
----
20+
oc exec logging-fluentd-lmvms logs
21+
----
22+
+
23+
The contents of log files are printed out, starting with the oldest log. Use `-f` option to follow what is being written into the logs.
24+
25+
* If you are using `LOGGING_FILE_PATH=console`, fluentd to write logs to STDOUT. You can retrieve the logs with the `oc logs -f <pod_name>` command.
26+
+
27+
For example
28+
+
29+
----
30+
oc logs -f /var/log/fluentd/fluentd.log
31+
----
32+
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * logging/efk-logging-fluentd.adoc
4+
5+
[id='efk-logging-fluentd-pod-location_{context}']
6+
= Viewing Fluentd pods
7+
8+
You can use the `oc get pods -o wide` command to see the nodes where the Fluentd pod are deployed.
9+
10+
.Procedure
11+
12+
Run the following command:
13+
14+
----
15+
$ oc get pods -o wide
16+
17+
NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE
18+
logging-es-data-master-5av030lk-1-2x494 2/2 Running 0 38m 154.128.0.80 ip-153-12-8-6.wef.internal <none>
19+
logging-fluentd-lqdxg 1/1 Running 0 2m 154.128.0.85 ip-153-12-8-6.wef.internal <none>
20+
logging-kibana-1-gj5kc 2/2 Running 0 39m 154.128.0.77 ip-153-12-8-6.wef.internal <none>
21+
----

modules/efk-logging-fluentd-throttling.adoc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,4 +100,3 @@ Use the `oc patch` command to modify the daemonset nodeSelector:
100100
----
101101
oc patch ds logging-fluentd -p '{"spec":{"template":{"spec":{"nodeSelector":{"logging-infra-fluentd":"true"}}}}}'
102102
----
103-

0 commit comments

Comments
 (0)