Skip to content

Commit 12006ae

Browse files
committed
simplify sections about TCP/AMQP in Logstash & GELF
1 parent 42ca79c commit 12006ae

File tree

1 file changed

+42
-43
lines changed

1 file changed

+42
-43
lines changed

content/feature/logger/_index.en.md

Lines changed: 42 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ weight: 3
1818
- [Using Syslog](#using-syslog)
1919
- [Using GELF](#using-gelf)
2020
- [Using Logstash](#using-logstash)
21-
- [TCP protocol configuration](#tcp-protocol-configuration)
22-
- [AMQP protocol configuration](#amqp-protocol-configuration)
2321
- [The different levels of logs in PHP](#usage)
2422

2523
---
@@ -45,7 +43,6 @@ First, you need to specify the name of your channel in which your logs will be w
4543

4644
```yaml
4745
- example_step:
48-
foo: bar
4946
logger:
5047
channel: pipeline
5148
```
@@ -65,12 +62,11 @@ handler will be triggered with the `level` option.
6562

6663
```yaml
6764
- example_step:
68-
foo: bar
6965
logger:
7066
# ...
7167
destinations:
7268
- stream:
73-
path: /my/path
69+
path: var/example.log
7470
level: warning
7571
```
7672

@@ -87,7 +83,6 @@ Next, you need to set the various hosts for your ElasticSearch application.
8783

8884
```yaml
8985
- example_step:
90-
foo: bar
9186
logger:
9287
# ...
9388
destinations:
@@ -109,23 +104,38 @@ Next, you need to set the various hosts for your ElasticSearch application.
109104
The first thing to do is to set the minimum [logging level](#the-different-levels-of-logs-in-php) at which this handler will be triggered using the `level`
110105
option.
111106

112-
Next, you need to set the protocol you want to use: [AMQP](#amqp-protocol-configuration) or [TCP](#tcp-protocol-configuration).
107+
Next, you need to set the protocol you want to use: TCP or AMQP.
113108

114-
```yaml
109+
{{< tabs name="gelf" >}}
110+
111+
{{< tab name="TCP" codelang="yaml" >}}
112+
- example_step:
113+
logger:
114+
# ...
115+
destinations:
116+
- gelf:
117+
level: warning
118+
tcp:
119+
host: gelf.example.com
120+
port: 100
121+
{{< /tab >}}
122+
123+
{{< tab name="AMQP" codelang="yaml" >}}
115124
- example_step:
116-
foo: bar
117125
logger:
118126
# ...
119127
destinations:
120128
- gelf:
121129
level: warning
122130
amqp:
123-
queue: my_queue_nama
131+
queue: my_queue_name
124132
host: example.com
125133
port: 100
126134
login: foo
127135
password: password
128-
```
136+
{{< /tab >}}
137+
138+
{{< /tabs >}}
129139

130140
#### Using Logstash
131141

@@ -135,11 +145,12 @@ When setting up your connection to Logstash, you should first set the name of yo
135145
using the `application_name` option and the minimum [logging level](#the-different-levels-of-logs-in-php) at which this handler will be
136146
with the `level` option.
137147

138-
Next, you need to set the protocol you want to use: [TCP](#tcp-protocol-configuration) or [AMQP](#amqp-protocol-configuration).
148+
Next, you need to set the protocol you want to use: TCP or AMQP.
139149

140-
```yaml
150+
{{< tabs name="logstash" >}}
151+
152+
{{< tab name="TCP" codelang="yaml" >}}
141153
- example_step:
142-
foo: bar
143154
logger:
144155
# ...
145156
destinations:
@@ -149,37 +160,25 @@ Next, you need to set the protocol you want to use: [TCP](#tcp-protocol-configur
149160
tcp:
150161
host: logstash.example.com
151162
port: 100
152-
```
153-
154-
### TCP protocol configuration
155-
156-
> TCP, Transmission Control Protocol, is a standardised protocol for the transmission of data between different
157-
> subscribers to a computer network.
158-
159-
The configuration for TCP is simple, you only need to set the `host` and `port` options on your system.
163+
{{< /tab >}}
160164

161-
```yaml
162-
tcp:
163-
host: example.com
164-
port: 100
165-
```
166-
167-
### AMQP protocol configuration
168-
169-
> AMQP, Advanced Message Queuing Protocol, is a standardised transfer and framing protocol for the asynchronous,
170-
> secure and reliable transfer of messages.
171-
172-
For the AMQP protocol, you need to define the name of your `queue`, the `host` and `port` of your application,
173-
and the login credentials (`login` and `password`).
165+
{{< tab name="AMQP" codelang="yaml" >}}
166+
- example_step:
167+
logger:
168+
# ...
169+
destinations:
170+
- logstash:
171+
application_name: my_log_system
172+
level: warning
173+
amqp:
174+
queue: my_queue_name
175+
host: example.com
176+
port: 100
177+
login: foo
178+
password: password
179+
{{< /tab >}}
174180

175-
```yaml
176-
amqp:
177-
queue: my_queue_nama
178-
host: example.com
179-
port: 100
180-
login: foo
181-
password: password
182-
```
181+
{{< /tabs >}}
183182

184183
### The different levels of logs in PHP
185184

0 commit comments

Comments
 (0)