Skip to content

Commit 69a1817

Browse files
ldeztraefiker
authored andcommitted
Improve some parts of the documentation.
1 parent a918dcd commit 69a1817

File tree

3 files changed

+68
-43
lines changed

3 files changed

+68
-43
lines changed

docs/content/observability/logs.md

Lines changed: 38 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,41 +5,57 @@ Reading What's Happening
55

66
By default, logs are written to stdout, in text format.
77

8-
## Configuration Example
9-
10-
??? example "Writing Logs in a File"
11-
12-
```toml
13-
[log]
14-
filePath = "/path/to/traefik.log"
15-
```
16-
17-
??? example "Writing Logs in a File, in JSON"
18-
19-
```toml
20-
[log]
21-
filePath = "/path/to/log-file.log"
22-
format = "json"
23-
```
24-
25-
## Configuration Options
8+
## Configuration
269

2710
### General
2811

2912
Traefik logs concern everything that happens to Traefik itself (startup, configuration, events, shutdown, and so on).
3013

31-
#### filePath
14+
#### `filePath`
3215

3316
By default, the logs are written to the standard output.
3417
You can configure a file path instead using the `filePath` option.
3518

36-
#### format
19+
```toml tab="File"
20+
# Writing Logs to a File
21+
[log]
22+
filePath = "/path/to/traefik.log"
23+
```
24+
25+
```bash tab="CLI"
26+
# Writing Logs to a File
27+
--log.filePath="/path/to/traefik.log"
28+
```
29+
30+
#### `format`
3731

3832
By default, the logs use a text format (`common`), but you can also ask for the `json` format in the `format` option.
3933

40-
#### log level
34+
```toml tab="File"
35+
# Writing Logs to a File, in JSON
36+
[log]
37+
filePath = "/path/to/log-file.log"
38+
format = "json"
39+
```
40+
41+
```bash tab="CLI"
42+
# Writing Logs to a File, in JSON
43+
--log.filePath="/path/to/traefik.log"
44+
--log.format="json"
45+
```
46+
47+
#### `level`
48+
49+
By default, the `level` is set to `ERROR`. Alternative logging levels are `DEBUG`, `PANIC`, `FATAL`, `ERROR`, `WARN`, and `INFO`.
50+
51+
```toml tab="File"
52+
[log]
53+
level = "DEBUG"
54+
```
4155

42-
By default, the `level` is set to `error`, but you can choose amongst `debug`, `panic`, `fatal`, `error`, `warn`, and `info`.
56+
```bash tab="CLI"
57+
--log.level="DEBUG"
58+
```
4359

4460
## Log Rotation
4561

docs/content/routing/entrypoints.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,22 +44,22 @@ You can define them using a toml file, CLI arguments, or a key-value store.
4444
See the complete reference for the list of available options:
4545

4646
```toml tab="File"
47-
[EntryPoints]
47+
[entryPoints]
4848

49-
[EntryPoints.EntryPoint0]
49+
[entryPoints.EntryPoint0]
5050
Address = ":8888"
51-
[EntryPoints.EntryPoint0.Transport]
52-
[EntryPoints.EntryPoint0.Transport.LifeCycle]
51+
[entryPoints.EntryPoint0.Transport]
52+
[entryPoints.EntryPoint0.Transport.LifeCycle]
5353
RequestAcceptGraceTimeout = 42
5454
GraceTimeOut = 42
55-
[EntryPoints.EntryPoint0.Transport.RespondingTimeouts]
55+
[entryPoints.EntryPoint0.Transport.RespondingTimeouts]
5656
ReadTimeout = 42
5757
WriteTimeout = 42
5858
IdleTimeout = 42
59-
[EntryPoints.EntryPoint0.ProxyProtocol]
59+
[entryPoints.EntryPoint0.ProxyProtocol]
6060
Insecure = true
6161
TrustedIPs = ["foobar", "foobar"]
62-
[EntryPoints.EntryPoint0.ForwardedHeaders]
62+
[entryPoints.EntryPoint0.ForwardedHeaders]
6363
Insecure = true
6464
TrustedIPs = ["foobar", "foobar"]
6565
```

docs/content/routing/routers/index.md

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,10 @@ In the process, routers may use pieces of [middleware](../../middlewares/overvie
3636
[entryPoints.mysql-default]
3737
address = ":80"
3838
[entryPoints.mysql-default]
39-
address = ":3306"
40-
39+
address = ":3306"
40+
```
41+
42+
```toml
4143
[tcp]
4244
[tcp.routers]
4345
[tcp.routers.to-database]
@@ -50,8 +52,8 @@ In the process, routers may use pieces of [middleware](../../middlewares/overvie
5052

5153
### EntryPoints
5254

53-
If not specified, HTTP routers will accept requests from all defined entrypoints.
54-
If you want to limit the router scope to a set of entrypoints, set the entrypoints option.
55+
If not specified, HTTP routers will accept requests from all defined entry points.
56+
If you want to limit the router scope to a set of entry points, set the `entryPoints` option.
5557

5658
??? example "Listens to Every EntryPoint"
5759

@@ -63,7 +65,9 @@ If you want to limit the router scope to a set of entrypoints, set the entrypoin
6365
# ...
6466
[entryPoints.other]
6567
# ...
66-
68+
```
69+
70+
```toml
6771
[http.routers]
6872
[http.routers.Router-1]
6973
# By default, routers listen to every entrypoints
@@ -81,7 +85,9 @@ If you want to limit the router scope to a set of entrypoints, set the entrypoin
8185
# ...
8286
[entryPoints.other]
8387
# ...
84-
88+
```
89+
90+
```toml
8591
[http.routers]
8692
[http.routers.Router-1]
8793
entryPoints = ["web-secure", "other"] # won't listen to entrypoint web
@@ -97,14 +103,15 @@ If the rule is verified, the router becomes active, calls middlewares, and then
97103
??? example "Host is traefik.io"
98104

99105
```toml
100-
rule = "Host(`traefik.io`)"
106+
rule = "Host(`traefik.io`)"
101107
```
102108

103109
??? example "Host is traefik.io OR Host is containo.us AND path is /traefik"
104110

105111
```toml
106-
rule = "Host(`traefik.io`) || (Host(`containo.us`) && Path(`/traefik`))"
112+
rule = "Host(`traefik.io`) || (Host(`containo.us`) && Path(`/traefik`))"
107113
```
114+
108115
The table below lists all the available matchers:
109116

110117
| Rule | Description |
@@ -126,7 +133,7 @@ The table below lists all the available matchers:
126133

127134
!!! tip "Combining Matchers Using Operators and Parenthesis"
128135

129-
You can combine multiple matchers using the AND (`&&`) and OR (`||) operators. You can also use parenthesis.
136+
You can combine multiple matchers using the AND (`&&`) and OR (`||`) operators. You can also use parenthesis.
130137

131138
!!! important "Rule, Middleware, and Services"
132139

@@ -212,7 +219,6 @@ It refers to a [tlsOptions](../../https/tls.md#tls-options) and will be applied
212219
[http.routers.Router-1.tls] # will terminate the TLS request
213220
options = "foo"
214221

215-
216222
[tlsOptions]
217223
[tlsOptions.foo]
218224
minVersion = "VersionTLS12"
@@ -234,7 +240,7 @@ If no matching route is found for the TCP routers, then the HTTP routers will ta
234240
If not specified, TCP routers will accept requests from all defined entry points.
235241
If you want to limit the router scope to a set of entry points, set the entry points option.
236242

237-
??? example "Listens to Every EntryPoint"
243+
??? example "Listens to Every Entry Point"
238244

239245
```toml
240246
[entryPoints]
@@ -244,7 +250,9 @@ If you want to limit the router scope to a set of entry points, set the entry po
244250
# ...
245251
[entryPoints.other]
246252
# ...
247-
253+
```
254+
255+
```toml
248256
[tcp.routers]
249257
[tcp.routers.Router-1]
250258
# By default, routers listen to every entrypoints
@@ -253,7 +261,7 @@ If you want to limit the router scope to a set of entry points, set the entry po
253261
[tcp.routers.Router-1.tls] # will route TLS requests (and ignore non tls requests)
254262
```
255263

256-
??? example "Listens to Specific EntryPoints"
264+
??? example "Listens to Specific Entry Points"
257265

258266
```toml
259267
[entryPoints]
@@ -263,7 +271,9 @@ If you want to limit the router scope to a set of entry points, set the entry po
263271
# ...
264272
[entryPoints.other]
265273
# ...
274+
```
266275

276+
```toml
267277
[tcp.routers]
268278
[tcp.routers.Router-1]
269279
entryPoints = ["web-secure", "other"] # won't listen to entrypoint web
@@ -340,7 +350,6 @@ It refers to a [tlsOptions](../../https/tls.md#tls-options) and will be applied
340350
[tcp.routers.Router-1.tls] # will terminate the TLS request
341351
options = "foo"
342352

343-
344353
[tlsOptions]
345354
[tlsOptions.foo]
346355
minVersion = "VersionTLS12"

0 commit comments

Comments
 (0)