Skip to content

Commit

Permalink
Improve some parts of the documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
ldez authored and traefiker committed Jun 21, 2019
1 parent a918dcd commit 69a1817
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 43 deletions.
60 changes: 38 additions & 22 deletions docs/content/observability/logs.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,41 +5,57 @@ Reading What's Happening

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

## Configuration Example

??? example "Writing Logs in a File"

```toml
[log]
filePath = "/path/to/traefik.log"
```

??? example "Writing Logs in a File, in JSON"

```toml
[log]
filePath = "/path/to/log-file.log"
format = "json"
```

## Configuration Options
## Configuration

### General

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

#### filePath
#### `filePath`

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

#### format
```toml tab="File"
# Writing Logs to a File
[log]
filePath = "/path/to/traefik.log"
```

```bash tab="CLI"
# Writing Logs to a File
--log.filePath="/path/to/traefik.log"
```

#### `format`

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

#### log level
```toml tab="File"
# Writing Logs to a File, in JSON
[log]
filePath = "/path/to/log-file.log"
format = "json"
```

```bash tab="CLI"
# Writing Logs to a File, in JSON
--log.filePath="/path/to/traefik.log"
--log.format="json"
```

#### `level`

By default, the `level` is set to `ERROR`. Alternative logging levels are `DEBUG`, `PANIC`, `FATAL`, `ERROR`, `WARN`, and `INFO`.

```toml tab="File"
[log]
level = "DEBUG"
```

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

## Log Rotation

Expand Down
14 changes: 7 additions & 7 deletions docs/content/routing/entrypoints.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,22 +44,22 @@ You can define them using a toml file, CLI arguments, or a key-value store.
See the complete reference for the list of available options:

```toml tab="File"
[EntryPoints]
[entryPoints]

[EntryPoints.EntryPoint0]
[entryPoints.EntryPoint0]
Address = ":8888"
[EntryPoints.EntryPoint0.Transport]
[EntryPoints.EntryPoint0.Transport.LifeCycle]
[entryPoints.EntryPoint0.Transport]
[entryPoints.EntryPoint0.Transport.LifeCycle]
RequestAcceptGraceTimeout = 42
GraceTimeOut = 42
[EntryPoints.EntryPoint0.Transport.RespondingTimeouts]
[entryPoints.EntryPoint0.Transport.RespondingTimeouts]
ReadTimeout = 42
WriteTimeout = 42
IdleTimeout = 42
[EntryPoints.EntryPoint0.ProxyProtocol]
[entryPoints.EntryPoint0.ProxyProtocol]
Insecure = true
TrustedIPs = ["foobar", "foobar"]
[EntryPoints.EntryPoint0.ForwardedHeaders]
[entryPoints.EntryPoint0.ForwardedHeaders]
Insecure = true
TrustedIPs = ["foobar", "foobar"]
```
Expand Down
37 changes: 23 additions & 14 deletions docs/content/routing/routers/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,10 @@ In the process, routers may use pieces of [middleware](../../middlewares/overvie
[entryPoints.mysql-default]
address = ":80"
[entryPoints.mysql-default]
address = ":3306"
address = ":3306"
```

```toml
[tcp]
[tcp.routers]
[tcp.routers.to-database]
Expand All @@ -50,8 +52,8 @@ In the process, routers may use pieces of [middleware](../../middlewares/overvie

### EntryPoints

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

??? example "Listens to Every EntryPoint"

Expand All @@ -63,7 +65,9 @@ If you want to limit the router scope to a set of entrypoints, set the entrypoin
# ...
[entryPoints.other]
# ...

```

```toml
[http.routers]
[http.routers.Router-1]
# By default, routers listen to every entrypoints
Expand All @@ -81,7 +85,9 @@ If you want to limit the router scope to a set of entrypoints, set the entrypoin
# ...
[entryPoints.other]
# ...

```

```toml
[http.routers]
[http.routers.Router-1]
entryPoints = ["web-secure", "other"] # won't listen to entrypoint web
Expand All @@ -97,14 +103,15 @@ If the rule is verified, the router becomes active, calls middlewares, and then
??? example "Host is traefik.io"

```toml
rule = "Host(`traefik.io`)"
rule = "Host(`traefik.io`)"
```

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

```toml
rule = "Host(`traefik.io`) || (Host(`containo.us`) && Path(`/traefik`))"
rule = "Host(`traefik.io`) || (Host(`containo.us`) && Path(`/traefik`))"
```

The table below lists all the available matchers:

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

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

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

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

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


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

??? example "Listens to Every EntryPoint"
??? example "Listens to Every Entry Point"

```toml
[entryPoints]
Expand All @@ -244,7 +250,9 @@ If you want to limit the router scope to a set of entry points, set the entry po
# ...
[entryPoints.other]
# ...

```

```toml
[tcp.routers]
[tcp.routers.Router-1]
# By default, routers listen to every entrypoints
Expand All @@ -253,7 +261,7 @@ If you want to limit the router scope to a set of entry points, set the entry po
[tcp.routers.Router-1.tls] # will route TLS requests (and ignore non tls requests)
```

??? example "Listens to Specific EntryPoints"
??? example "Listens to Specific Entry Points"

```toml
[entryPoints]
Expand All @@ -263,7 +271,9 @@ If you want to limit the router scope to a set of entry points, set the entry po
# ...
[entryPoints.other]
# ...
```

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


[tlsOptions]
[tlsOptions.foo]
minVersion = "VersionTLS12"
Expand Down

0 comments on commit 69a1817

Please sign in to comment.