From c14ae3039071159162d21bf4ea04aadb85392129 Mon Sep 17 00:00:00 2001 From: Buphido Date: Thu, 2 Sep 2021 14:13:50 +0200 Subject: [PATCH 01/23] Removed warnings from http_oauth2_test.go --- server/http_oauth2_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/server/http_oauth2_test.go b/server/http_oauth2_test.go index 50de6a0f9..572a6fc9d 100644 --- a/server/http_oauth2_test.go +++ b/server/http_oauth2_test.go @@ -348,7 +348,7 @@ func TestOAuth2_AccessControl(t *testing.T) { subT.Errorf("%q: expected Status %d, got: %d", tc.name, tc.status, res.StatusCode) } - tokenResBytes, err := io.ReadAll(res.Body) + tokenResBytes, _ := io.ReadAll(res.Body) var jData map[string]interface{} json.Unmarshal(tokenResBytes, &jData) if params, ok := jData["form_params"]; ok { @@ -356,16 +356,16 @@ func TestOAuth2_AccessControl(t *testing.T) { subT.Errorf("%q: expected params %s, got: %s", tc.name, tc.params, params) } } else { - if "" != tc.params { + if tc.params != "" { subT.Errorf("%q: expected params %s, got no", tc.name, tc.params) } } if authorization, ok := jData["authorization"]; ok { - if authorization != tc.authorization { + if tc.authorization != authorization { subT.Errorf("%q: expected authorization %s, got: %s", tc.name, tc.authorization, authorization) } } else { - if "" != tc.authorization { + if tc.authorization != "" { subT.Errorf("%q: expected authorization %s, got no", tc.name, tc.authorization) } } From 08fc712dbdcc5951ced5654c24eb87923317f6d6 Mon Sep 17 00:00:00 2001 From: Buphido Date: Thu, 2 Sep 2021 18:25:52 +0200 Subject: [PATCH 02/23] Added rudimentary LOGS.md --- docs/LOGS.md | 121 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 121 insertions(+) create mode 100644 docs/LOGS.md diff --git a/docs/LOGS.md b/docs/LOGS.md new file mode 100644 index 000000000..d81cea3f2 --- /dev/null +++ b/docs/LOGS.md @@ -0,0 +1,121 @@ +# Log Functionality Couper + +__Logs__ are the information being printed in the console upon the execution of __Couper__. There are a few different [Log Types](#log-types) and several different [Fields](#fields) containing useful information given in said __Logs__ to be remembered, but you can adjust the __Logs'__ appearance and verbosity with a variety of [Features](#features) to make sure that the information you seek is available as easily as possible. + +These __Logs__ are still _subject to change_ however. We aspire to make __Couper__ as stable as possible and that includes these __Logs__, so until we believe to have achieved that goal you should expect to see some changes. + +## Log Types + +| Type | Description | +| :-------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------- | +| `couper_access` | Provides information about the frontend side of things. For information about its [Fields](#fields), see [Access Fields](#access-fields). | +| `couper_access_tls` | For information about its [Fields](#fields), see [TLS Access Fields](#tls-access-fields). | +| `couper_backend` | Provides information about the backend side of things. For information about its [Fields](#fields), see [Backend Fields](#backend-fields). | +| `couper_daemon` | Provides information about the start-up and shut-down of __Couper__ in the form of multiple __Logs__. It is here where the main purpose of the `message` [Field](#fields) lies, as each printed __Log__ of this type will contain a `message` entry regarding either the start-up or shut-down of __Couper__. For information about its [Fields](#fields), see [Daemon Fields](#daemon-fields). | + +## Fields + +Given the large amount of information contained in several __Logs__, see [Features](#features) to change the format or level of intricacy with which __Logs__ are printed. + +### Common Fields + +These are a part of all [Log Types](#log-types) and are hence mentioned seperately to avoid unnecessary redundancy. + +| Name | Description | +| :------------ | :------------------------------------------------ | +| `"build”` | git short hash | +| `"level"` | configured log level, determines verbosity of log | +| `"message”` | context based | +| `"timestamp"` | request starting time | +| `"type"`  | Type of log | +| `"version"` | Release version | + +### Access Fields + +These are found in the [Log Type](#log-types) `couper_access` in addition to the [Common Fields](#common-fields). + +| Name | Description | +| :------------------------ | :------------ | +| `"auth_user"` | basic auth username (if provided) | +| `"client_ip"` | ip of client | +| `"endpoint"` | path pattern of endpoint | +| `"handler"` | type of handler (endpoint, file, spa) | +| `"method"` | http request method (GET, POST, OPTIONS) (maybe with link to mozilla http request method open source) | +| `"port"` | current port accepting request | +| `"request": {` | field regarding request information | +|   `"bytes"` | body size of request | +|   `"headers"` | field regarding keys and values originating from configured keys/header names | +|   `"host"` | f | +|   `"method"` | mirroring top level | +|   `"origin"` | . | +|   `"path"` | . | +|   `"proto"` | . | +|   `"status"` | . | +|   `"tls" }` | . | +| `"response": {` | field regarding response info | +|   `"bytes"` | body size of response | +|   `"headers" }` | field regarding keys and values originating from configured keys/header names | +| `"server"` | Server name (defined in couper file) | +| `"status"` | response status code | +| `"timings": {` | field regarding timing | +|   `"total" }` | total time taken | +| `“uid"` | unique request id configurable in unique id settings (maybe link) | +| `"url"` | url | + +### TLS Access Fields + +These are found in the [Log Type](#log-types) `couper_access_tls` in addition to the [Common Fields](#common-fields). + +| Name | Description | +| :------------------------ | :------------ | +| | . | + +### Backend Fields + +These are the [Fields](#fields) found in the [Log Type](#log-types) `couper_backend` in addition to the [Common Fields](#common-fields). + +| Name | Description | +| :------------------------ | :------------ | +| `"auth_user"` | backend request basic auth username (if provided) | +| `"backend"` | name can be set, “default” otherwise | +| `"method"` | http request method (GET, POST, OPTIONS) (maybe with link to mozilla http request method open source) | +| `"proxy"` | . | +| `"request": {` | . | +|   `"bytes"` | . | +|   `"headers"` | . | +|   `"host"` | . | +|   `"method"` | . | +|   `"name"` | . | +|   `"origin"` | . | +|   `"path"` | . | +|   `"port"` | . | +|   `"proto" }` | . | +| `"response": {` | . | +|   `"headers"` | . | +|   `"status" }` | . | +| `"status"` | . |  +| `"timings": {` | . | +|   `"dns"` | connect to which ip | +|   `"tcp"` | connect time | +|   `"tls"` | time after connection for handshake | +|   `"total"` | . | +|   `"ttfb" }` | time to first byte | +| `"token_request"` | link to documentation | +| `"token_request_retry"` |  How many attempts at request, documentation | +| `"uid"` | . | +| `"url"` | . | +| `"validation"` | validation result for open api (link to config) | + +### Daemon Fields + +These are found in the [Log Type](#log-types) `couper_daemon` in addition to the [Common Fields](#common-fields). + +| Name | Description | +| :------------------------ | :------------ | +| | | + +## Features + +| Feature | Description | +| :-------- | :------------ | +| | | \ No newline at end of file From 571aa0090d6173da5de9fa66f42a41ef7c16961a Mon Sep 17 00:00:00 2001 From: Buphido Date: Fri, 3 Sep 2021 10:49:17 +0200 Subject: [PATCH 03/23] Changes to read and utilize previously removed err --- server/http_oauth2_test.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/http_oauth2_test.go b/server/http_oauth2_test.go index 572a6fc9d..aa3445c57 100644 --- a/server/http_oauth2_test.go +++ b/server/http_oauth2_test.go @@ -348,7 +348,9 @@ func TestOAuth2_AccessControl(t *testing.T) { subT.Errorf("%q: expected Status %d, got: %d", tc.name, tc.status, res.StatusCode) } - tokenResBytes, _ := io.ReadAll(res.Body) + tokenResBytes, err := io.ReadAll(res.Body) + helper.Must(err) + var jData map[string]interface{} json.Unmarshal(tokenResBytes, &jData) if params, ok := jData["form_params"]; ok { From 03b8315be6f072111b81ad1060d2385eee871036 Mon Sep 17 00:00:00 2001 From: Buphido Date: Fri, 3 Sep 2021 11:50:36 +0200 Subject: [PATCH 04/23] added table of contents, adjusted changelog --- CHANGELOG.md | 1 + docs/LOGS.md | 50 +++++++++++++++++++++++++++++++++----------------- 2 files changed, 34 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c082be0c0..26a4e62a9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ Unreleased changes are available as `avenga/couper:edge` container. * **Added** * `Accept: application/json` request header to the OAuth2 token request, in order to make the Github token endpoint respond with a JSON token response ([#307](https://github.com/avenga/couper/pull/307)) + * Documentation of [logs](docs/LOGS.md) ([#310](https://github.com/avenga/couper/pull/310)) * **Changed** * Organized log format fields for uniform access and upstream log ([#300](https://github.com/avenga/couper/pull/300)) diff --git a/docs/LOGS.md b/docs/LOGS.md index d81cea3f2..42eb45e2e 100644 --- a/docs/LOGS.md +++ b/docs/LOGS.md @@ -1,21 +1,30 @@ -# Log Functionality Couper +- [Introduction](#introduction) + - [Log Types](#log-types) + - [Fields](#fields) + - [Access Fields](#access-fields) + - [TLS Access Fields](#tls-access-fields) + - [Backend Fields](#backend-fields) + - [Daemon Fields](#daemon-fields) + - [Features](#features) -__Logs__ are the information being printed in the console upon the execution of __Couper__. There are a few different [Log Types](#log-types) and several different [Fields](#fields) containing useful information given in said __Logs__ to be remembered, but you can adjust the __Logs'__ appearance and verbosity with a variety of [Features](#features) to make sure that the information you seek is available as easily as possible. +# Introduction -These __Logs__ are still _subject to change_ however. We aspire to make __Couper__ as stable as possible and that includes these __Logs__, so until we believe to have achieved that goal you should expect to see some changes. +_Logs_ are the information being printed in the console upon the execution of Couper. There are a few different [Log Types](#log-types) and several different [Fields](#fields) containing useful information given in said _Logs_ to be remembered, but you can adjust the _Logs'_ appearance and verbosity with a variety of [Features](#features) to make sure that the information you seek is available as easily as possible. + +These _Logs_ are however still subject to change. We aspire to make Couper as stable as possible and that includes the _Logs_, so until we believe to have achieved that goal you should expect to see some changes. ## Log Types -| Type | Description | -| :-------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------- | -| `couper_access` | Provides information about the frontend side of things. For information about its [Fields](#fields), see [Access Fields](#access-fields). | -| `couper_access_tls` | For information about its [Fields](#fields), see [TLS Access Fields](#tls-access-fields). | -| `couper_backend` | Provides information about the backend side of things. For information about its [Fields](#fields), see [Backend Fields](#backend-fields). | -| `couper_daemon` | Provides information about the start-up and shut-down of __Couper__ in the form of multiple __Logs__. It is here where the main purpose of the `message` [Field](#fields) lies, as each printed __Log__ of this type will contain a `message` entry regarding either the start-up or shut-down of __Couper__. For information about its [Fields](#fields), see [Daemon Fields](#daemon-fields). | +| Type | Description | +| :-------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------ | +| `couper_access` | Provides information about the frontend side of things. For information about its [Fields](#fields), see [Access Fields](#access-fields). | +| `couper_access_tls` | Provides information about connection to TLS proxies. For information about its [Fields](#fields), see [TLS Access Fields](#tls-access-fields). | +| `couper_backend` | Provides information about the backend side of things. For information about its [Fields](#fields), see [Backend Fields](#backend-fields). | +| `couper_daemon` | Provides information about the start-up and shut-down of Couper in the form of multiple _Logs_. It is here where the main purpose of the `message` [Field](#fields) lies, as each printed _Log_ of this type will contain a `message` entry regarding either the start-up or shut-down of Couper. For information about its [Fields](#fields), see [Daemon Fields](#daemon-fields). | ## Fields -Given the large amount of information contained in several __Logs__, see [Features](#features) to change the format or level of intricacy with which __Logs__ are printed. +Given the large amount of information contained in several _Logs_, see [Features](#features) to change the format or level of intricacy with which _Logs_ are printed. ### Common Fields @@ -45,7 +54,7 @@ These are found in the [Log Type](#log-types) `couper_access` in addition to the | `"request": {` | field regarding request information | |   `"bytes"` | body size of request | |   `"headers"` | field regarding keys and values originating from configured keys/header names | -|   `"host"` | f | +|   `"host"` | . | |   `"method"` | mirroring top level | |   `"origin"` | . | |   `"path"` | . | @@ -110,12 +119,19 @@ These are the [Fields](#fields) found in the [Log Type](#log-types) `couper_back These are found in the [Log Type](#log-types) `couper_daemon` in addition to the [Common Fields](#common-fields). -| Name | Description | -| :------------------------ | :------------ | -| | | +| Name | Description | +| :---------------------------- | :------------ | +| `"deadline"` | . | +| `"delay"` | . | +| `"watch": {` | . | +|   `"max-retries",` | . | +|   `"retry-delay" }` | . | ## Features -| Feature | Description | -| :-------- | :------------ | -| | | \ No newline at end of file +| Feature | Default | Description | +| :------------ | :-------- | :---------------------------------------------------------------------------------------- | +| `log-format` | `common` | Can be set to `json` output format. | +| `log-level` | `info` | Set the log-level to one of: `info`, `panic`, `fatal`, `error`, `warn`, `debug`, `trace`. | +| `log-pretty` | `false` | Option for `json` log format which pretty prints with basic key coloring. | +| `watch` | `false` | Watch for configuration file changes and reload on modifications. | \ No newline at end of file From 5cc45c20506b01fcac046e57a5ea374a5f760bb4 Mon Sep 17 00:00:00 2001 From: Buphido Date: Fri, 3 Sep 2021 18:15:15 +0200 Subject: [PATCH 05/23] Progress in LOGS.md, small fixes in CLI.md --- docs/CLI.md | 16 +++--- docs/LOGS.md | 160 ++++++++++++++++++++++++++------------------------- 2 files changed, 89 insertions(+), 87 deletions(-) diff --git a/docs/CLI.md b/docs/CLI.md index f4025f84c..c49069312 100644 --- a/docs/CLI.md +++ b/docs/CLI.md @@ -15,15 +15,15 @@ Couper is build as binary called `couper` with the following commands: ## Global Options -| Argument | Default | Environment | Description | -| :------------------- | :----------- | :------------------------- | :-------------------------------------------------------------------------------------- | -| `-f` | `couper.hcl` | `COUPER_FILE` | File path to your Couper configuration file. | -| `-watch` | `false` | `COUPER_WATCH` | Watch for configuration file changes and reload on modifications. | -| `-watch-retries` | `5` | `COUPER_WATCH_RETRIES` | Maximal retry count for configuration reloads which could not bind the configured port. | -| `-watch-retry-delay` | `500ms` | `COUPER_WATCH_RETRY_DELAY` | Delay duration before next attempt if an error occurs. | -| `-log-format` | `common` | `COUPER_LOG_FORMAT` | Can be set to `json` output format. | +| Argument | Default | Environment | Description | +| :------------------- | :----------- | :------------------------- | :---------------------------------------------------------------------------------------- | +| `-f` | `couper.hcl` | `COUPER_FILE` | File path to your Couper configuration file. | +| `-watch` | `false` | `COUPER_WATCH` | Watch for configuration file changes and reload on modifications. | +| `-watch-retries` | `5` | `COUPER_WATCH_RETRIES` | Maximum retry count for configuration reloads which could not bind the configured port. | +| `-watch-retry-delay` | `500ms` | `COUPER_WATCH_RETRY_DELAY` | Delay duration before next attempt if an error occurs. | +| `-log-format` | `common` | `COUPER_LOG_FORMAT` | Can be set to `json` output format. | | `-log-level` | `info` | `COUPER_LOG_LEVEL` | Set the log-level to one of: `info`, `panic`, `fatal`, `error`, `warn`, `debug`, `trace`. | -| `-log-pretty` | `false` | `COUPER_LOG_PRETTY` | Option for `json` log format which pretty prints with basic key coloring. | +| `-log-pretty` | `false` | `COUPER_LOG_PRETTY` | Option for `json` log format which pretty prints with basic key coloring. | _Note_: `log-format` and `log-pretty` also maps to [settings](REFERENCE.md#settings-block). diff --git a/docs/LOGS.md b/docs/LOGS.md index 42eb45e2e..195c2d21d 100644 --- a/docs/LOGS.md +++ b/docs/LOGS.md @@ -15,12 +15,12 @@ These _Logs_ are however still subject to change. We aspire to make Couper as st ## Log Types -| Type | Description | -| :-------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------ | -| `couper_access` | Provides information about the frontend side of things. For information about its [Fields](#fields), see [Access Fields](#access-fields). | -| `couper_access_tls` | Provides information about connection to TLS proxies. For information about its [Fields](#fields), see [TLS Access Fields](#tls-access-fields). | -| `couper_backend` | Provides information about the backend side of things. For information about its [Fields](#fields), see [Backend Fields](#backend-fields). | -| `couper_daemon` | Provides information about the start-up and shut-down of Couper in the form of multiple _Logs_. It is here where the main purpose of the `message` [Field](#fields) lies, as each printed _Log_ of this type will contain a `message` entry regarding either the start-up or shut-down of Couper. For information about its [Fields](#fields), see [Daemon Fields](#daemon-fields). | +| Type | Description | +| :------------------ | :---------------------------------------------------------------------------------------------------------------------------------------------- | +| `couper_access` | Provides information about the frontend side of things. For information about its [Fields](#fields), see [Access Fields](#access-fields). | +| `couper_access_tls` | Provides information about connection to TLS proxies. For information about its [Fields](#fields), see [TLS Access Fields](#tls-access-fields). | +| `couper_backend` | Provides information about the backend side of things. For information about its [Fields](#fields), see [Backend Fields](#backend-fields). | +| `couper_daemon` | Provides information about the start-up and shut-down of Couper in the form of multiple _Logs_. It is here where the main purpose of the `message` [Field](#fields) lies, as each printed _Log_ of this type will contain a `message` entry regarding either the start-up or shut-down of Couper. For information about its [Fields](#fields), see [Daemon Fields](#daemon-fields). | ## Fields @@ -34,42 +34,42 @@ These are a part of all [Log Types](#log-types) and are hence mentioned seperate | :------------ | :------------------------------------------------ | | `"build”` | git short hash | | `"level"` | configured log level, determines verbosity of log | -| `"message”` | context based | +| `"message”` | context based, mainly used in `couper_daemon` | | `"timestamp"` | request starting time | -| `"type"`  | Type of log | -| `"version"` | Release version | +| `"type"`  | [Log Type](#log-types) | +| `"version"` | release version | ### Access Fields These are found in the [Log Type](#log-types) `couper_access` in addition to the [Common Fields](#common-fields). -| Name | Description | -| :------------------------ | :------------ | -| `"auth_user"` | basic auth username (if provided) | -| `"client_ip"` | ip of client | -| `"endpoint"` | path pattern of endpoint | -| `"handler"` | type of handler (endpoint, file, spa) | -| `"method"` | http request method (GET, POST, OPTIONS) (maybe with link to mozilla http request method open source) | -| `"port"` | current port accepting request | -| `"request": {` | field regarding request information | -|   `"bytes"` | body size of request | -|   `"headers"` | field regarding keys and values originating from configured keys/header names | -|   `"host"` | . | -|   `"method"` | mirroring top level | -|   `"origin"` | . | -|   `"path"` | . | -|   `"proto"` | . | -|   `"status"` | . | -|   `"tls" }` | . | -| `"response": {` | field regarding response info | -|   `"bytes"` | body size of response | -|   `"headers" }` | field regarding keys and values originating from configured keys/header names | -| `"server"` | Server name (defined in couper file) | -| `"status"` | response status code | -| `"timings": {` | field regarding timing | -|   `"total" }` | total time taken | -| `“uid"` | unique request id configurable in unique id settings (maybe link) | -| `"url"` | url | +| Name | Description | +| :------------------------ | :--------------------------------------------------------------------------------------------------------------------------- | +| `"auth_user"` | basic auth username (if provided) | +| `"client_ip"` | ip of client | +| `"endpoint"` | path pattern of endpoint | +| `"handler"` | one of: `endpoint`, `file`, `spa` | +| `"method"` | http request method, see [Mozilla Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods) for more information | +| `"port"` | current port accepting request | +| `"request": {` | field regarding request information | +|   `"bytes"` | body size of request | +|   `"headers"` | field regarding keys and values originating from configured keys/header names | +|   `"host"` | host of request | +|   `"method"` | http request method, see [Mozilla Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods) for more information | +|   `"origin"` | origin of request | +|   `"path"` | path of request | +|   `"proto"` | protocol of request | +|   `"status"` | status of request | +|   `"tls" }` | TLS used `true`or `false` | +| `"response": {` | field regarding response info | +|   `"bytes"` | body size of response | +|   `"headers" }` | field regarding keys and values originating from configured keys/header names | +| `"server"` | server name (defined in couper file) | +| `"status"` | response status code | +| `"timings": {` | field regarding timing | +|   `"total" }` | total time taken | +| `“uid"` | unique request id configurable in [Settings](../docs/REFERENCE.md#settings-block) | +| `"url"` | complete url (`://:` or `://`) | ### TLS Access Fields @@ -77,61 +77,63 @@ These are found in the [Log Type](#log-types) `couper_access_tls` in addition to | Name | Description | | :------------------------ | :------------ | -| | . | +| . | . | ### Backend Fields These are the [Fields](#fields) found in the [Log Type](#log-types) `couper_backend` in addition to the [Common Fields](#common-fields). -| Name | Description | -| :------------------------ | :------------ | -| `"auth_user"` | backend request basic auth username (if provided) | -| `"backend"` | name can be set, “default” otherwise | -| `"method"` | http request method (GET, POST, OPTIONS) (maybe with link to mozilla http request method open source) | -| `"proxy"` | . | -| `"request": {` | . | -|   `"bytes"` | . | -|   `"headers"` | . | -|   `"host"` | . | -|   `"method"` | . | -|   `"name"` | . | -|   `"origin"` | . | -|   `"path"` | . | -|   `"port"` | . | -|   `"proto" }` | . | -| `"response": {` | . | -|   `"headers"` | . | -|   `"status" }` | . | -| `"status"` | . |  -| `"timings": {` | . | -|   `"dns"` | connect to which ip | -|   `"tcp"` | connect time | -|   `"tls"` | time after connection for handshake | -|   `"total"` | . | -|   `"ttfb" }` | time to first byte | -| `"token_request"` | link to documentation | -| `"token_request_retry"` |  How many attempts at request, documentation | -| `"uid"` | . | -| `"url"` | . | -| `"validation"` | validation result for open api (link to config) | +| Name | Description | +| :----------------------- | :--------------------------------------------------------------------------------------------------------------------------- | +| `"auth_user"` | backend request basic auth username (if provided) | +| `"backend"` | name can be set, “default” otherwise | +| `"method"` | http request method, see [Mozilla Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods) for more information | +| `"proxy"` | . | +| `"request": {` | field regarding request information | +|   `"bytes"` | body size of request | +|   `"headers"` | field regarding keys and values originating from configured keys/header names | +|   `"host"` | host of request | +|   `"method"` | http request method, see [Mozilla Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods) for more information | +|   `"name"` | . | +|   `"origin"` | origin of request | +|   `"path"` | path of request | +|   `"port"` | current port accepting request | +|   `"proto"` | protocol of request | +| `"response": {` | field regarding response information | +|   `"headers"` | field regarding keys and values originating from configured keys/header names | +|   `"status" }` | status of response | +| `"status"` | status of response |  +| `"timings": {` | field regarding timing | +|   `"dns"` | time taken by dns | +|   `"tcp"` | time taken between attempting and establishing connection | +|   `"tls"` | time taken between attempt and success at tls handshake | +|   `"total"` | total time taken | +|   `"ttfb" }` | time to first byte/between establishing connection and receiving first byte | +| `"token_request"` | . | +| `"token_request_retry"` | how many attempts at `token_request` | +| `"uid"` | . | +| `"url"` | . | +| `"validation"` | validation result for open api (link to config pending) | ### Daemon Fields These are found in the [Log Type](#log-types) `couper_daemon` in addition to the [Common Fields](#common-fields). -| Name | Description | -| :---------------------------- | :------------ | +| Name | Description | +| :---------------------------- | :------------------------------------------------------------------------------------------------------------------------- | | `"deadline"` | . | | `"delay"` | . | -| `"watch": {` | . | -|   `"max-retries",` | . | -|   `"retry-delay" }` | . | +| `"watch": {` | field watching configuration file changes, logs with this field only appear if `watch=true`, more in [Features](#features) | +|   `"max-retries",` | maximum retry count, see [Global Options](../docs/CLI.md#global-options) | +|   `"retry-delay" }` | configured delay of each retry, see [Global Options](../docs/CLI.md#global-options) | ## Features -| Feature | Default | Description | -| :------------ | :-------- | :---------------------------------------------------------------------------------------- | -| `log-format` | `common` | Can be set to `json` output format. | -| `log-level` | `info` | Set the log-level to one of: `info`, `panic`, `fatal`, `error`, `warn`, `debug`, `trace`. | -| `log-pretty` | `false` | Option for `json` log format which pretty prints with basic key coloring. | -| `watch` | `false` | Watch for configuration file changes and reload on modifications. | \ No newline at end of file +For more information regarding the usage of these features, see the documentations regarding the [Command Line Interface](../docs/CLI.md#global-options), [Enviromment Options](../DOCKER.md#environment-options) and/or [Settings](REFERENCE.md#settings-block). + +| Feature | Description | +| :----------- | :---------------------------------------------------------------------------------------------------------------------------------- | +| `log-format` | Can be set to either `common` or `json` output format. | +| `log-level` | Can be set to one of: `panic`, `fatal`, `error`, `warn`, `info`, `debug` and `trace`. For more information regarding the usage of each, see the official documentation of [Level](https://pkg.go.dev/github.com/sirupsen/logrus@v1.8.1#Level). | +| `log-pretty` | Option for `log-format=json` which pretty prints with basic key coloring. | +| `watch` | Watch for configuration file changes and reload on modifications. Resulting information manifests in [Daemon Logs](#daemon-fields). | \ No newline at end of file From 1229f8a1d97df97290bafcd07fc52a224aa7fe9c Mon Sep 17 00:00:00 2001 From: Buphido Date: Mon, 6 Sep 2021 13:26:19 +0200 Subject: [PATCH 06/23] Finished LOGS.md first draft --- docs/CLI.md | 2 +- docs/LOGS.md | 43 +++++++++++++++++-------------------------- 2 files changed, 18 insertions(+), 27 deletions(-) diff --git a/docs/CLI.md b/docs/CLI.md index c49069312..092f8b835 100644 --- a/docs/CLI.md +++ b/docs/CLI.md @@ -25,7 +25,7 @@ Couper is build as binary called `couper` with the following commands: | `-log-level` | `info` | `COUPER_LOG_LEVEL` | Set the log-level to one of: `info`, `panic`, `fatal`, `error`, `warn`, `debug`, `trace`. | | `-log-pretty` | `false` | `COUPER_LOG_PRETTY` | Option for `json` log format which pretty prints with basic key coloring. | -_Note_: `log-format` and `log-pretty` also maps to [settings](REFERENCE.md#settings-block). +_Note_: `log-format`, `log-level` and `log-pretty` also map to [settings](REFERENCE.md#settings-block). ## Run Options diff --git a/docs/LOGS.md b/docs/LOGS.md index 195c2d21d..a27512c28 100644 --- a/docs/LOGS.md +++ b/docs/LOGS.md @@ -2,7 +2,6 @@ - [Log Types](#log-types) - [Fields](#fields) - [Access Fields](#access-fields) - - [TLS Access Fields](#tls-access-fields) - [Backend Fields](#backend-fields) - [Daemon Fields](#daemon-fields) - [Features](#features) @@ -18,9 +17,9 @@ These _Logs_ are however still subject to change. We aspire to make Couper as st | Type | Description | | :------------------ | :---------------------------------------------------------------------------------------------------------------------------------------------- | | `couper_access` | Provides information about the frontend side of things. For information about its [Fields](#fields), see [Access Fields](#access-fields). | -| `couper_access_tls` | Provides information about connection to TLS proxies. For information about its [Fields](#fields), see [TLS Access Fields](#tls-access-fields). | +| `couper_access_tls` | Provides information about connection to TLS proxies. For information about its [Fields](#fields), see [Access Fields](#access-fields). | | `couper_backend` | Provides information about the backend side of things. For information about its [Fields](#fields), see [Backend Fields](#backend-fields). | -| `couper_daemon` | Provides information about the start-up and shut-down of Couper in the form of multiple _Logs_. It is here where the main purpose of the `message` [Field](#fields) lies, as each printed _Log_ of this type will contain a `message` entry regarding either the start-up or shut-down of Couper. For information about its [Fields](#fields), see [Daemon Fields](#daemon-fields). | +| `couper_daemon` | Provides background information about the execution of Couper. It is here where the main purpose of the `message` [Field](#fields) lies, as each printed _Log_ of this type will contain a `message` entry containing a description of the current actions of Couper. For information about its [Fields](#fields), see [Daemon Fields](#daemon-fields). | ## Fields @@ -41,7 +40,7 @@ These are a part of all [Log Types](#log-types) and are hence mentioned seperate ### Access Fields -These are found in the [Log Type](#log-types) `couper_access` in addition to the [Common Fields](#common-fields). +These are found in the [Log Types](#log-types) `couper_access` and `couper_access_tls` in addition to the [Common Fields](#common-fields). | Name | Description | | :------------------------ | :--------------------------------------------------------------------------------------------------------------------------- | @@ -60,8 +59,8 @@ These are found in the [Log Type](#log-types) `couper_access` in addition to the |   `"path"` | path of request | |   `"proto"` | protocol of request | |   `"status"` | status of request | -|   `"tls" }` | TLS used `true`or `false` | -| `"response": {` | field regarding response info | +|   `"tls" }` | TLS used `true` or `false` | +| `"response": {` | field regarding response information | |   `"bytes"` | body size of response | |   `"headers" }` | field regarding keys and values originating from configured keys/header names | | `"server"` | server name (defined in couper file) | @@ -71,14 +70,6 @@ These are found in the [Log Type](#log-types) `couper_access` in addition to the | `“uid"` | unique request id configurable in [Settings](../docs/REFERENCE.md#settings-block) | | `"url"` | complete url (`://:` or `://`) | -### TLS Access Fields - -These are found in the [Log Type](#log-types) `couper_access_tls` in addition to the [Common Fields](#common-fields). - -| Name | Description | -| :------------------------ | :------------ | -| . | . | - ### Backend Fields These are the [Fields](#fields) found in the [Log Type](#log-types) `couper_backend` in addition to the [Common Fields](#common-fields). @@ -86,34 +77,34 @@ These are the [Fields](#fields) found in the [Log Type](#log-types) `couper_back | Name | Description | | :----------------------- | :--------------------------------------------------------------------------------------------------------------------------- | | `"auth_user"` | backend request basic auth username (if provided) | -| `"backend"` | name can be set, “default” otherwise | +| `"backend"` | configured name, `default` if not provided | | `"method"` | http request method, see [Mozilla Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods) for more information | -| `"proxy"` | . | +| `"proxy"` | used system proxy url (if configured), see [Proxy Block](../docs/REFERENCE.md#proxy-block) | | `"request": {` | field regarding request information | |   `"bytes"` | body size of request | |   `"headers"` | field regarding keys and values originating from configured keys/header names | |   `"host"` | host of request | |   `"method"` | http request method, see [Mozilla Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods) for more information | -|   `"name"` | . | +|   `"name"` | configured request name, `default` if not provided | |   `"origin"` | origin of request | |   `"path"` | path of request | |   `"port"` | current port accepting request | -|   `"proto"` | protocol of request | +|   `"proto" }` | protocol of request | | `"response": {` | field regarding response information | |   `"headers"` | field regarding keys and values originating from configured keys/header names | |   `"status" }` | status of response | | `"status"` | status of response |  | `"timings": {` | field regarding timing | |   `"dns"` | time taken by dns | -|   `"tcp"` | time taken between attempting and establishing connection | +|   `"tcp"` | time taken between attempting and establishing tcp connection | |   `"tls"` | time taken between attempt and success at tls handshake | |   `"total"` | total time taken | |   `"ttfb" }` | time to first byte/between establishing connection and receiving first byte | -| `"token_request"` | . | +| `"token_request"` | entry regarding request for token | | `"token_request_retry"` | how many attempts at `token_request` | -| `"uid"` | . | -| `"url"` | . | -| `"validation"` | validation result for open api (link to config pending) | +| `"uid"` | unique request id configurable in [Settings](../docs/REFERENCE.md#settings-block) | +| `"url"` | complete url (`://:` or `://`) | +| `"validation"` | validation result for open api, see [OpenAPI Block](../docs/REFERENCE.md#openapi-block) | ### Daemon Fields @@ -121,15 +112,15 @@ These are found in the [Log Type](#log-types) `couper_daemon` in addition to the | Name | Description | | :---------------------------- | :------------------------------------------------------------------------------------------------------------------------- | -| `"deadline"` | . | -| `"delay"` | . | +| `"deadline"` | shutdown parameter, see [Health-Check](../docs/REFERENCE.md#health-check) | +| `"delay"` | shutdown parameter, see [Health-Check](../docs/REFERENCE.md#health-check) | | `"watch": {` | field watching configuration file changes, logs with this field only appear if `watch=true`, more in [Features](#features) | |   `"max-retries",` | maximum retry count, see [Global Options](../docs/CLI.md#global-options) | |   `"retry-delay" }` | configured delay of each retry, see [Global Options](../docs/CLI.md#global-options) | ## Features -For more information regarding the usage of these features, see the documentations regarding the [Command Line Interface](../docs/CLI.md#global-options), [Enviromment Options](../DOCKER.md#environment-options) and/or [Settings](REFERENCE.md#settings-block). +For more information regarding the usage of these features, see the documentations regarding the [Command Line Interface](../docs/CLI.md#global-options), [Environment Options](../DOCKER.md#environment-options) and/or [Settings](REFERENCE.md#settings-block). | Feature | Description | | :----------- | :---------------------------------------------------------------------------------------------------------------------------------- | From 27dbe8e33134fb71c17aae5861c44bc2ee0aad7d Mon Sep 17 00:00:00 2001 From: Buphido Date: Tue, 7 Sep 2021 11:55:14 +0200 Subject: [PATCH 07/23] first changes to LOGS, fixed bug in upstream_log --- docs/LOGS.md | 34 +++++++++++++++++----------------- logging/upstream_log.go | 4 ++-- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/docs/LOGS.md b/docs/LOGS.md index a27512c28..75123bb35 100644 --- a/docs/LOGS.md +++ b/docs/LOGS.md @@ -4,11 +4,11 @@ - [Access Fields](#access-fields) - [Backend Fields](#backend-fields) - [Daemon Fields](#daemon-fields) - - [Features](#features) + - [Settings](#settings) # Introduction -_Logs_ are the information being printed in the console upon the execution of Couper. There are a few different [Log Types](#log-types) and several different [Fields](#fields) containing useful information given in said _Logs_ to be remembered, but you can adjust the _Logs'_ appearance and verbosity with a variety of [Features](#features) to make sure that the information you seek is available as easily as possible. +_Logs_ are the information being printed in the console upon the execution of Couper. There are a few different [Log Types](#log-types) and several different [Fields](#fields) containing useful information given in said _Logs_ to be remembered, but you can adjust the _Logs'_ appearance and verbosity with a variety of [Settings](#settings) to make sure that the information you seek is available as easily as possible. These _Logs_ are however still subject to change. We aspire to make Couper as stable as possible and that includes the _Logs_, so until we believe to have achieved that goal you should expect to see some changes. @@ -17,13 +17,13 @@ These _Logs_ are however still subject to change. We aspire to make Couper as st | Type | Description | | :------------------ | :---------------------------------------------------------------------------------------------------------------------------------------------- | | `couper_access` | Provides information about the frontend side of things. For information about its [Fields](#fields), see [Access Fields](#access-fields). | -| `couper_access_tls` | Provides information about connection to TLS proxies. For information about its [Fields](#fields), see [Access Fields](#access-fields). | +| `couper_access_tls` | Provides information about connections via configured [https_dev_proxy](./REFERENCE.md#settings). For information about its [Fields](#fields), see [Access Fields](#access-fields). | | `couper_backend` | Provides information about the backend side of things. For information about its [Fields](#fields), see [Backend Fields](#backend-fields). | | `couper_daemon` | Provides background information about the execution of Couper. It is here where the main purpose of the `message` [Field](#fields) lies, as each printed _Log_ of this type will contain a `message` entry containing a description of the current actions of Couper. For information about its [Fields](#fields), see [Daemon Fields](#daemon-fields). | ## Fields -Given the large amount of information contained in several _Logs_, see [Features](#features) to change the format or level of intricacy with which _Logs_ are printed. +Given the large amount of information contained in several _Logs_, see [Settings](#settings) to change the format or level of intricacy with which _Logs_ are printed. ### Common Fields @@ -31,7 +31,7 @@ These are a part of all [Log Types](#log-types) and are hence mentioned seperate | Name | Description | | :------------ | :------------------------------------------------ | -| `"build”` | git short hash | +| `"build”` | git short hash during build time | | `"level"` | configured log level, determines verbosity of log | | `"message”` | context based, mainly used in `couper_daemon` | | `"timestamp"` | request starting time | @@ -67,7 +67,7 @@ These are found in the [Log Types](#log-types) `couper_access` and `couper_acces | `"status"` | response status code | | `"timings": {` | field regarding timing | |   `"total" }` | total time taken | -| `“uid"` | unique request id configurable in [Settings](../docs/REFERENCE.md#settings-block) | +| `“uid"` | unique request id configurable in [Settings](./REFERENCE.md#settings-block) | | `"url"` | complete url (`://:` or `://`) | ### Backend Fields @@ -79,7 +79,7 @@ These are the [Fields](#fields) found in the [Log Type](#log-types) `couper_back | `"auth_user"` | backend request basic auth username (if provided) | | `"backend"` | configured name, `default` if not provided | | `"method"` | http request method, see [Mozilla Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods) for more information | -| `"proxy"` | used system proxy url (if configured), see [Proxy Block](../docs/REFERENCE.md#proxy-block) | +| `"proxy"` | used system proxy url (if configured), see [Proxy Block](./REFERENCE.md#proxy-block) | | `"request": {` | field regarding request information | |   `"bytes"` | body size of request | |   `"headers"` | field regarding keys and values originating from configured keys/header names | @@ -101,10 +101,10 @@ These are the [Fields](#fields) found in the [Log Type](#log-types) `couper_back |   `"total"` | total time taken | |   `"ttfb" }` | time to first byte/between establishing connection and receiving first byte | | `"token_request"` | entry regarding request for token | -| `"token_request_retry"` | how many attempts at `token_request` | -| `"uid"` | unique request id configurable in [Settings](../docs/REFERENCE.md#settings-block) | +| `"token_request_retry"` | how many `token_request` attempts were made | +| `"uid"` | unique request id configurable in [Settings](./REFERENCE.md#settings-block) | | `"url"` | complete url (`://:` or `://`) | -| `"validation"` | validation result for open api, see [OpenAPI Block](../docs/REFERENCE.md#openapi-block) | +| `"validation"` | validation result for open api, see [OpenAPI Block](./REFERENCE.md#openapi-block) | ### Daemon Fields @@ -112,15 +112,15 @@ These are found in the [Log Type](#log-types) `couper_daemon` in addition to the | Name | Description | | :---------------------------- | :------------------------------------------------------------------------------------------------------------------------- | -| `"deadline"` | shutdown parameter, see [Health-Check](../docs/REFERENCE.md#health-check) | -| `"delay"` | shutdown parameter, see [Health-Check](../docs/REFERENCE.md#health-check) | -| `"watch": {` | field watching configuration file changes, logs with this field only appear if `watch=true`, more in [Features](#features) | -|   `"max-retries",` | maximum retry count, see [Global Options](../docs/CLI.md#global-options) | -|   `"retry-delay" }` | configured delay of each retry, see [Global Options](../docs/CLI.md#global-options) | +| `"deadline"` | shutdown parameter, see [Health-Check](./REFERENCE.md#health-check) | +| `"delay"` | shutdown parameter, see [Health-Check](./REFERENCE.md#health-check) | +| `"watch": {` | field watching configuration file changes, logs with this field only appear if `watch=true`, more in [Settings](#settings) | +|   `"max-retries",` | maximum retry count, see [Global Options](./CLI.md#global-options) | +|   `"retry-delay" }` | configured delay of each retry, see [Global Options](./CLI.md#global-options) | -## Features +## Settings -For more information regarding the usage of these features, see the documentations regarding the [Command Line Interface](../docs/CLI.md#global-options), [Environment Options](../DOCKER.md#environment-options) and/or [Settings](REFERENCE.md#settings-block). +For more information regarding the usage of these settings, see the documentations regarding [Command Line Interface](./CLI.md#global-options), [Environment Options](./../DOCKER.md#environment-options) and/or [All Settings](./REFERENCE.md#settings-block). | Feature | Description | | :----------- | :---------------------------------------------------------------------------------------------------------------------------------- | diff --git a/logging/upstream_log.go b/logging/upstream_log.go index 1c01c2096..626b56270 100644 --- a/logging/upstream_log.go +++ b/logging/upstream_log.go @@ -79,8 +79,8 @@ func (u *UpstreamLog) RoundTrip(req *http.Request) (*http.Response, error) { if req.Host != "" { requestFields["origin"] = req.Host requestFields["host"], requestFields["port"] = splitHostPort(req.Host) - if fields["port"] == "" { - delete(fields, "port") + if requestFields["port"] == "" { + delete(requestFields, "port") } } From b048273f1e8530620ed0e20491afb314821a208e Mon Sep 17 00:00:00 2001 From: Buphido Date: Tue, 7 Sep 2021 13:06:23 +0200 Subject: [PATCH 08/23] Added reference for origin --- docs/LOGS.md | 116 +++++++++++++++++++++++++-------------------------- 1 file changed, 58 insertions(+), 58 deletions(-) diff --git a/docs/LOGS.md b/docs/LOGS.md index 75123bb35..24f48392b 100644 --- a/docs/LOGS.md +++ b/docs/LOGS.md @@ -42,69 +42,69 @@ These are a part of all [Log Types](#log-types) and are hence mentioned seperate These are found in the [Log Types](#log-types) `couper_access` and `couper_access_tls` in addition to the [Common Fields](#common-fields). -| Name | Description | -| :------------------------ | :--------------------------------------------------------------------------------------------------------------------------- | -| `"auth_user"` | basic auth username (if provided) | -| `"client_ip"` | ip of client | -| `"endpoint"` | path pattern of endpoint | -| `"handler"` | one of: `endpoint`, `file`, `spa` | -| `"method"` | http request method, see [Mozilla Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods) for more information | -| `"port"` | current port accepting request | -| `"request": {` | field regarding request information | -|   `"bytes"` | body size of request | -|   `"headers"` | field regarding keys and values originating from configured keys/header names | -|   `"host"` | host of request | -|   `"method"` | http request method, see [Mozilla Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods) for more information | -|   `"origin"` | origin of request | -|   `"path"` | path of request | -|   `"proto"` | protocol of request | -|   `"status"` | status of request | -|   `"tls" }` | TLS used `true` or `false` | -| `"response": {` | field regarding response information | -|   `"bytes"` | body size of response | -|   `"headers" }` | field regarding keys and values originating from configured keys/header names | -| `"server"` | server name (defined in couper file) | -| `"status"` | response status code | -| `"timings": {` | field regarding timing | -|   `"total" }` | total time taken | -| `“uid"` | unique request id configurable in [Settings](./REFERENCE.md#settings-block) | -| `"url"` | complete url (`://:` or `://`) | +| Name | Description | +| :------------------------ | :-------------------------------------------------------------------------------------------------------------------------------- | +| `"auth_user"` | basic auth username (if provided) | +| `"client_ip"` | ip of client | +| `"endpoint"` | path pattern of endpoint | +| `"handler"` | one of: `endpoint`, `file`, `spa` | +| `"method"` | http request method, see [Mozilla HTTP Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods) for more information | +| `"port"` | current port accepting request | +| `"request": {` | field regarding request information | +|   `"bytes"` | request body size in bytes | +|   `"headers"` | field regarding keys and values originating from configured keys/header names | +|   `"host"` | request host | +|   `"method"` | http request method, see [Mozilla HTTP Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods) for more information | +|   `"origin"` | request origin (`://:`), for our purposes excluding `://` in printing, see [Mozilla HTTP Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Origin) for more information | +|   `"path"` | request path | +|   `"proto"` | request protocol | +|   `"status"` | request status code, see [Mozilla HTTP Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status) for more information | +|   `"tls" }` | TLS used `true` or `false` | +| `"response": {` | field regarding response information | +|   `"bytes"` | response body size in bytes | +|   `"headers" }` | field regarding keys and values originating from configured keys/header names | +| `"server"` | server name (defined in couper file) | +| `"status"` | response status code, see [Mozilla HTTP Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status) for more information | +| `"timings": {` | field regarding timing | +|   `"total" }` | total time taken | +| `“uid"` | unique request id configurable in [Settings](./REFERENCE.md#settings-block) | +| `"url"` | complete url (`://:` or ``) | ### Backend Fields These are the [Fields](#fields) found in the [Log Type](#log-types) `couper_backend` in addition to the [Common Fields](#common-fields). -| Name | Description | -| :----------------------- | :--------------------------------------------------------------------------------------------------------------------------- | -| `"auth_user"` | backend request basic auth username (if provided) | -| `"backend"` | configured name, `default` if not provided | -| `"method"` | http request method, see [Mozilla Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods) for more information | -| `"proxy"` | used system proxy url (if configured), see [Proxy Block](./REFERENCE.md#proxy-block) | -| `"request": {` | field regarding request information | -|   `"bytes"` | body size of request | -|   `"headers"` | field regarding keys and values originating from configured keys/header names | -|   `"host"` | host of request | -|   `"method"` | http request method, see [Mozilla Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods) for more information | -|   `"name"` | configured request name, `default` if not provided | -|   `"origin"` | origin of request | -|   `"path"` | path of request | -|   `"port"` | current port accepting request | -|   `"proto" }` | protocol of request | -| `"response": {` | field regarding response information | -|   `"headers"` | field regarding keys and values originating from configured keys/header names | -|   `"status" }` | status of response | -| `"status"` | status of response |  -| `"timings": {` | field regarding timing | -|   `"dns"` | time taken by dns | -|   `"tcp"` | time taken between attempting and establishing tcp connection | -|   `"tls"` | time taken between attempt and success at tls handshake | -|   `"total"` | total time taken | -|   `"ttfb" }` | time to first byte/between establishing connection and receiving first byte | -| `"token_request"` | entry regarding request for token | -| `"token_request_retry"` | how many `token_request` attempts were made | -| `"uid"` | unique request id configurable in [Settings](./REFERENCE.md#settings-block) | -| `"url"` | complete url (`://:` or `://`) | -| `"validation"` | validation result for open api, see [OpenAPI Block](./REFERENCE.md#openapi-block) | +| Name | Description | +| :----------------------- | :-------------------------------------------------------------------------------------------------------------------------------- | +| `"auth_user"` | backend request basic auth username (if provided) | +| `"backend"` | configured name, `default` if not provided | +| `"method"` | http request method, see [Mozilla HTTP Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods) for more information | +| `"proxy"` | used system proxy url (if configured), see [Proxy Block](./REFERENCE.md#proxy-block) | +| `"request": {` | field regarding request information | +|   `"bytes"` | request body size in bytes | +|   `"headers"` | field regarding keys and values originating from configured keys/header names | +|   `"host"` | request host | +|   `"method"` | http request method, see [Mozilla HTTP Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods) for more information | +|   `"name"` | configured request name, `default` if not provided | +|   `"origin"` | request origin, for our purposes excluding `://` in printing, see [Mozilla HTTP Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Origin) for more information | +|   `"path"` | request path | +|   `"port"` | current port accepting request | +|   `"proto" }` | request protocol | +| `"response": {` | field regarding response information | +|   `"headers"` | field regarding keys and values originating from configured keys/header names | +|   `"status" }` | response status code, see [Mozilla HTTP Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status) for more information | +| `"status"` | response status code, see [Mozilla HTTP Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status) for more information | +| `"timings": {` | field regarding timing | +|   `"dns"` | time taken by dns | +|   `"tcp"` | time taken between attempting and establishing tcp connection | +|   `"tls"` | time taken between attempt and success at tls handshake | +|   `"total"` | total time taken | +|   `"ttfb" }` | time to first byte/between establishing connection and receiving first byte | +| `"token_request"` | entry regarding request for token | +| `"token_request_retry"` | how many `token_request` attempts were made | +| `"uid"` | unique request id configurable in [Settings](./REFERENCE.md#settings-block) | +| `"url"` | complete url (`://:` or ``) | +| `"validation"` | validation result for open api, see [OpenAPI Block](./REFERENCE.md#openapi-block) | ### Daemon Fields From c848156b1db4b41f8f278a4cf86e133136abe66b Mon Sep 17 00:00:00 2001 From: Christopher Overdiek <85127559+Buphido@users.noreply.github.com> Date: Thu, 9 Sep 2021 11:21:57 +0200 Subject: [PATCH 09/23] Update docs/LOGS.md Co-authored-by: vwuerbel --- docs/LOGS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/LOGS.md b/docs/LOGS.md index 24f48392b..a104b8ac0 100644 --- a/docs/LOGS.md +++ b/docs/LOGS.md @@ -8,7 +8,7 @@ # Introduction -_Logs_ are the information being printed in the console upon the execution of Couper. There are a few different [Log Types](#log-types) and several different [Fields](#fields) containing useful information given in said _Logs_ to be remembered, but you can adjust the _Logs'_ appearance and verbosity with a variety of [Settings](#settings) to make sure that the information you seek is available as easily as possible. +Upon the execution of Couper all log events are sent to the standard output. You can adjust the appearance and verbosity of the logs with a variety of [Settings](#settings). There are different [Log Types](#log-types) and [Fields](#fields) containing useful information.``` These _Logs_ are however still subject to change. We aspire to make Couper as stable as possible and that includes the _Logs_, so until we believe to have achieved that goal you should expect to see some changes. From 6342d909c4759141460bf29e698469aeddc6fdb5 Mon Sep 17 00:00:00 2001 From: Christopher Overdiek <85127559+Buphido@users.noreply.github.com> Date: Thu, 9 Sep 2021 11:22:10 +0200 Subject: [PATCH 10/23] Update docs/LOGS.md Co-authored-by: vwuerbel --- docs/LOGS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/LOGS.md b/docs/LOGS.md index a104b8ac0..5c7e3aa4a 100644 --- a/docs/LOGS.md +++ b/docs/LOGS.md @@ -10,7 +10,7 @@ Upon the execution of Couper all log events are sent to the standard output. You can adjust the appearance and verbosity of the logs with a variety of [Settings](#settings). There are different [Log Types](#log-types) and [Fields](#fields) containing useful information.``` -These _Logs_ are however still subject to change. We aspire to make Couper as stable as possible and that includes the _Logs_, so until we believe to have achieved that goal you should expect to see some changes. +> We aspire to make Couper as stable as possible so these logs are still subject to change. ## Log Types From 3046a1227ba433a5d5390a4018f126af43d70925 Mon Sep 17 00:00:00 2001 From: Christopher Overdiek <85127559+Buphido@users.noreply.github.com> Date: Thu, 9 Sep 2021 11:22:36 +0200 Subject: [PATCH 11/23] Update docs/LOGS.md Co-authored-by: vwuerbel --- docs/LOGS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/LOGS.md b/docs/LOGS.md index 5c7e3aa4a..bc0063fab 100644 --- a/docs/LOGS.md +++ b/docs/LOGS.md @@ -16,7 +16,7 @@ Upon the execution of Couper all log events are sent to the standard output. You | Type | Description | | :------------------ | :---------------------------------------------------------------------------------------------------------------------------------------------- | -| `couper_access` | Provides information about the frontend side of things. For information about its [Fields](#fields), see [Access Fields](#access-fields). | +| `couper_access` | Provides information about the frontend side of things. Compare [Access Fields](#access-fields). | | `couper_access_tls` | Provides information about connections via configured [https_dev_proxy](./REFERENCE.md#settings). For information about its [Fields](#fields), see [Access Fields](#access-fields). | | `couper_backend` | Provides information about the backend side of things. For information about its [Fields](#fields), see [Backend Fields](#backend-fields). | | `couper_daemon` | Provides background information about the execution of Couper. It is here where the main purpose of the `message` [Field](#fields) lies, as each printed _Log_ of this type will contain a `message` entry containing a description of the current actions of Couper. For information about its [Fields](#fields), see [Daemon Fields](#daemon-fields). | From 36bf106ac4facfe3188fee803dd1dde6eb2427ff Mon Sep 17 00:00:00 2001 From: Christopher Overdiek <85127559+Buphido@users.noreply.github.com> Date: Thu, 9 Sep 2021 11:22:52 +0200 Subject: [PATCH 12/23] Update docs/LOGS.md Co-authored-by: vwuerbel --- docs/LOGS.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/LOGS.md b/docs/LOGS.md index bc0063fab..ad55f5888 100644 --- a/docs/LOGS.md +++ b/docs/LOGS.md @@ -1,4 +1,7 @@ -- [Introduction](#introduction) +# Logging + +- [Logging](#logging) + - [Introduction](#introduction) - [Log Types](#log-types) - [Fields](#fields) - [Access Fields](#access-fields) From fa7c659e4c4f2d306fc13fb7861cb5b6916b3806 Mon Sep 17 00:00:00 2001 From: Christopher Overdiek <85127559+Buphido@users.noreply.github.com> Date: Thu, 9 Sep 2021 11:23:06 +0200 Subject: [PATCH 13/23] Update docs/LOGS.md Co-authored-by: vwuerbel --- docs/LOGS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/LOGS.md b/docs/LOGS.md index ad55f5888..36b5ea22d 100644 --- a/docs/LOGS.md +++ b/docs/LOGS.md @@ -9,7 +9,7 @@ - [Daemon Fields](#daemon-fields) - [Settings](#settings) -# Introduction +## Introduction Upon the execution of Couper all log events are sent to the standard output. You can adjust the appearance and verbosity of the logs with a variety of [Settings](#settings). There are different [Log Types](#log-types) and [Fields](#fields) containing useful information.``` From dd899ab0038e0ec4ab270a58dec9b5daf9f7ec1b Mon Sep 17 00:00:00 2001 From: Christopher Overdiek <85127559+Buphido@users.noreply.github.com> Date: Thu, 9 Sep 2021 11:23:30 +0200 Subject: [PATCH 14/23] Update docs/LOGS.md Co-authored-by: vwuerbel --- docs/LOGS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/LOGS.md b/docs/LOGS.md index 36b5ea22d..780662e52 100644 --- a/docs/LOGS.md +++ b/docs/LOGS.md @@ -20,7 +20,7 @@ Upon the execution of Couper all log events are sent to the standard output. You | Type | Description | | :------------------ | :---------------------------------------------------------------------------------------------------------------------------------------------- | | `couper_access` | Provides information about the frontend side of things. Compare [Access Fields](#access-fields). | -| `couper_access_tls` | Provides information about connections via configured [https_dev_proxy](./REFERENCE.md#settings). For information about its [Fields](#fields), see [Access Fields](#access-fields). | +| `couper_access_tls` | Provides information about connections via configured [https_dev_proxy](./REFERENCE.md#settings). Compare [Access Fields](#access-fields). | | `couper_backend` | Provides information about the backend side of things. For information about its [Fields](#fields), see [Backend Fields](#backend-fields). | | `couper_daemon` | Provides background information about the execution of Couper. It is here where the main purpose of the `message` [Field](#fields) lies, as each printed _Log_ of this type will contain a `message` entry containing a description of the current actions of Couper. For information about its [Fields](#fields), see [Daemon Fields](#daemon-fields). | From 4c6bf444bdb64ca662a2e3ba0235e0ddd5a373c3 Mon Sep 17 00:00:00 2001 From: Christopher Overdiek <85127559+Buphido@users.noreply.github.com> Date: Thu, 9 Sep 2021 11:23:52 +0200 Subject: [PATCH 15/23] Update docs/LOGS.md Co-authored-by: vwuerbel --- docs/LOGS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/LOGS.md b/docs/LOGS.md index 780662e52..a0348b341 100644 --- a/docs/LOGS.md +++ b/docs/LOGS.md @@ -30,7 +30,7 @@ Given the large amount of information contained in several _Logs_, see [Settings ### Common Fields -These are a part of all [Log Types](#log-types) and are hence mentioned seperately to avoid unnecessary redundancy. +These fields are part of all [Log Types](#log-types) and therefore mentioned separately to avoid unnecessary redundancy. | Name | Description | | :------------ | :------------------------------------------------ | From 9951c4373ce476d42b5fb3956f9abece2d63279b Mon Sep 17 00:00:00 2001 From: Christopher Overdiek <85127559+Buphido@users.noreply.github.com> Date: Thu, 9 Sep 2021 11:24:03 +0200 Subject: [PATCH 16/23] Update docs/LOGS.md Co-authored-by: vwuerbel --- docs/LOGS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/LOGS.md b/docs/LOGS.md index a0348b341..bb5c09d66 100644 --- a/docs/LOGS.md +++ b/docs/LOGS.md @@ -43,7 +43,7 @@ These fields are part of all [Log Types](#log-types) and therefore mentioned sep ### Access Fields -These are found in the [Log Types](#log-types) `couper_access` and `couper_access_tls` in addition to the [Common Fields](#common-fields). +These fields are found in the [Log Types](#log-types) `couper_access` and `couper_access_tls` in addition to the [Common Fields](#common-fields). | Name | Description | | :------------------------ | :-------------------------------------------------------------------------------------------------------------------------------- | From 6de34a118de0e79794a3f59153f3215a35568305 Mon Sep 17 00:00:00 2001 From: Christopher Overdiek <85127559+Buphido@users.noreply.github.com> Date: Thu, 9 Sep 2021 11:24:20 +0200 Subject: [PATCH 17/23] Update docs/LOGS.md Co-authored-by: vwuerbel --- docs/LOGS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/LOGS.md b/docs/LOGS.md index bb5c09d66..4f6e8399f 100644 --- a/docs/LOGS.md +++ b/docs/LOGS.md @@ -21,7 +21,7 @@ Upon the execution of Couper all log events are sent to the standard output. You | :------------------ | :---------------------------------------------------------------------------------------------------------------------------------------------- | | `couper_access` | Provides information about the frontend side of things. Compare [Access Fields](#access-fields). | | `couper_access_tls` | Provides information about connections via configured [https_dev_proxy](./REFERENCE.md#settings). Compare [Access Fields](#access-fields). | -| `couper_backend` | Provides information about the backend side of things. For information about its [Fields](#fields), see [Backend Fields](#backend-fields). | +| `couper_backend` | Provides information about the backend side of things. Compare [Backend Fields](#backend-fields). | | `couper_daemon` | Provides background information about the execution of Couper. It is here where the main purpose of the `message` [Field](#fields) lies, as each printed _Log_ of this type will contain a `message` entry containing a description of the current actions of Couper. For information about its [Fields](#fields), see [Daemon Fields](#daemon-fields). | ## Fields From 49278d0832db89e92d60ddbdde5c3f3889a595d0 Mon Sep 17 00:00:00 2001 From: Christopher Overdiek <85127559+Buphido@users.noreply.github.com> Date: Thu, 9 Sep 2021 11:24:42 +0200 Subject: [PATCH 18/23] Update docs/LOGS.md Co-authored-by: vwuerbel --- docs/LOGS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/LOGS.md b/docs/LOGS.md index 4f6e8399f..d48e5cd40 100644 --- a/docs/LOGS.md +++ b/docs/LOGS.md @@ -22,7 +22,7 @@ Upon the execution of Couper all log events are sent to the standard output. You | `couper_access` | Provides information about the frontend side of things. Compare [Access Fields](#access-fields). | | `couper_access_tls` | Provides information about connections via configured [https_dev_proxy](./REFERENCE.md#settings). Compare [Access Fields](#access-fields). | | `couper_backend` | Provides information about the backend side of things. Compare [Backend Fields](#backend-fields). | -| `couper_daemon` | Provides background information about the execution of Couper. It is here where the main purpose of the `message` [Field](#fields) lies, as each printed _Log_ of this type will contain a `message` entry containing a description of the current actions of Couper. For information about its [Fields](#fields), see [Daemon Fields](#daemon-fields). | +| `couper_daemon` | Provides background information about the execution of Couper. Each printed log of this type contains a `message` entry describing the current actions of Couper. Compare [Daemon Fields](#daemon-fields). | ## Fields From c1804d583630663604b9baef40dea5a4927d29a0 Mon Sep 17 00:00:00 2001 From: Christopher Overdiek <85127559+Buphido@users.noreply.github.com> Date: Thu, 9 Sep 2021 11:25:04 +0200 Subject: [PATCH 19/23] Update docs/LOGS.md Co-authored-by: vwuerbel --- docs/LOGS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/LOGS.md b/docs/LOGS.md index d48e5cd40..506163524 100644 --- a/docs/LOGS.md +++ b/docs/LOGS.md @@ -26,7 +26,7 @@ Upon the execution of Couper all log events are sent to the standard output. You ## Fields -Given the large amount of information contained in several _Logs_, see [Settings](#settings) to change the format or level of intricacy with which _Logs_ are printed. +Given the large amount of information contained in some logs, it might come handy to change the format or log level (see [Settings](#settings)). ### Common Fields From e0b52ade5c68bef093d2350d1d043f83e42fbe72 Mon Sep 17 00:00:00 2001 From: Christopher Overdiek <85127559+Buphido@users.noreply.github.com> Date: Thu, 9 Sep 2021 11:25:21 +0200 Subject: [PATCH 20/23] Update docs/LOGS.md Co-authored-by: vwuerbel --- docs/LOGS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/LOGS.md b/docs/LOGS.md index 506163524..d4a649d8d 100644 --- a/docs/LOGS.md +++ b/docs/LOGS.md @@ -75,7 +75,7 @@ These fields are found in the [Log Types](#log-types) `couper_access` and `coupe ### Backend Fields -These are the [Fields](#fields) found in the [Log Type](#log-types) `couper_backend` in addition to the [Common Fields](#common-fields). +These fields are found in the [Log Type](#log-types) `couper_backend` in addition to the [Common Fields](#common-fields). | Name | Description | | :----------------------- | :-------------------------------------------------------------------------------------------------------------------------------- | From 9d189e9edf5641a98c61f3704e98886745427ea8 Mon Sep 17 00:00:00 2001 From: Christopher Overdiek <85127559+Buphido@users.noreply.github.com> Date: Thu, 9 Sep 2021 11:25:35 +0200 Subject: [PATCH 21/23] Update docs/LOGS.md Co-authored-by: vwuerbel --- docs/LOGS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/LOGS.md b/docs/LOGS.md index d4a649d8d..beba2cfa2 100644 --- a/docs/LOGS.md +++ b/docs/LOGS.md @@ -111,7 +111,7 @@ These fields are found in the [Log Type](#log-types) `couper_backend` in additio ### Daemon Fields -These are found in the [Log Type](#log-types) `couper_daemon` in addition to the [Common Fields](#common-fields). +These fields are found in the [Log Type](#log-types) `couper_daemon` in addition to the [Common Fields](#common-fields). | Name | Description | | :---------------------------- | :------------------------------------------------------------------------------------------------------------------------- | From 2eb1e946621fcfb95e734d6dd19910f4d6b2c5af Mon Sep 17 00:00:00 2001 From: Christopher Overdiek <85127559+Buphido@users.noreply.github.com> Date: Thu, 9 Sep 2021 11:25:54 +0200 Subject: [PATCH 22/23] Update docs/LOGS.md Co-authored-by: vwuerbel --- docs/LOGS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/LOGS.md b/docs/LOGS.md index beba2cfa2..9b55d8f95 100644 --- a/docs/LOGS.md +++ b/docs/LOGS.md @@ -123,7 +123,7 @@ These fields are found in the [Log Type](#log-types) `couper_daemon` in addition ## Settings -For more information regarding the usage of these settings, see the documentations regarding [Command Line Interface](./CLI.md#global-options), [Environment Options](./../DOCKER.md#environment-options) and/or [All Settings](./REFERENCE.md#settings-block). +For more information regarding the usage of these settings, compare the [Command Line Interface](./CLI.md#global-options) documentation, Couper's [Environment Options](./../DOCKER.md#environment-options) and/or the [Settings Block](./REFERENCE.md#settings-block) reference. | Feature | Description | | :----------- | :---------------------------------------------------------------------------------------------------------------------------------- | From 0e8ced0ba10ad9265de3ed102c2e4281bc8ed9c8 Mon Sep 17 00:00:00 2001 From: Buphido Date: Thu, 9 Sep 2021 12:05:58 +0200 Subject: [PATCH 23/23] Final changes to LOGS.md --- docs/LOGS.md | 158 ++++++++++++++++++++++++++++----------------------- 1 file changed, 86 insertions(+), 72 deletions(-) diff --git a/docs/LOGS.md b/docs/LOGS.md index 9b55d8f95..df3a092f4 100644 --- a/docs/LOGS.md +++ b/docs/LOGS.md @@ -11,18 +11,18 @@ ## Introduction -Upon the execution of Couper all log events are sent to the standard output. You can adjust the appearance and verbosity of the logs with a variety of [Settings](#settings). There are different [Log Types](#log-types) and [Fields](#fields) containing useful information.``` +Upon the execution of Couper all log events are sent to the standard output. You can adjust the appearance and verbosity of the logs with a variety of [Settings](#settings). There are different [Log Types](#log-types) and [Fields](#fields) containing useful information. > We aspire to make Couper as stable as possible so these logs are still subject to change. ## Log Types -| Type | Description | -| :------------------ | :---------------------------------------------------------------------------------------------------------------------------------------------- | -| `couper_access` | Provides information about the frontend side of things. Compare [Access Fields](#access-fields). | -| `couper_access_tls` | Provides information about connections via configured [https_dev_proxy](./REFERENCE.md#settings). Compare [Access Fields](#access-fields). | -| `couper_backend` | Provides information about the backend side of things. Compare [Backend Fields](#backend-fields). | -| `couper_daemon` | Provides background information about the execution of Couper. Each printed log of this type contains a `message` entry describing the current actions of Couper. Compare [Daemon Fields](#daemon-fields). | +| Type | Description | +| :------------------ | :----------------------------------------------------------------------------------------------------------------------------------------------- | +| `couper_access` | Provides information about the frontend side of things. Compare [Access Fields](#access-fields). | +| `couper_access_tls` | Provides information about connections via configured [https_dev_proxy](./REFERENCE.md#settings-block). Compare [Access Fields](#access-fields). | +| `couper_backend` | Provides information about the backend side of things. Compare [Backend Fields](#backend-fields). | +| `couper_daemon` | Provides background information about the execution of Couper. Each printed log of this type contains a `message` entry describing the current actions of Couper. Compare [Daemon Fields](#daemon-fields). | ## Fields @@ -45,81 +45,95 @@ These fields are part of all [Log Types](#log-types) and therefore mentioned sep These fields are found in the [Log Types](#log-types) `couper_access` and `couper_access_tls` in addition to the [Common Fields](#common-fields). -| Name | Description | -| :------------------------ | :-------------------------------------------------------------------------------------------------------------------------------- | -| `"auth_user"` | basic auth username (if provided) | -| `"client_ip"` | ip of client | -| `"endpoint"` | path pattern of endpoint | -| `"handler"` | one of: `endpoint`, `file`, `spa` | -| `"method"` | http request method, see [Mozilla HTTP Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods) for more information | -| `"port"` | current port accepting request | -| `"request": {` | field regarding request information | -|   `"bytes"` | request body size in bytes | -|   `"headers"` | field regarding keys and values originating from configured keys/header names | -|   `"host"` | request host | -|   `"method"` | http request method, see [Mozilla HTTP Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods) for more information | -|   `"origin"` | request origin (`://:`), for our purposes excluding `://` in printing, see [Mozilla HTTP Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Origin) for more information | -|   `"path"` | request path | -|   `"proto"` | request protocol | -|   `"status"` | request status code, see [Mozilla HTTP Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status) for more information | -|   `"tls" }` | TLS used `true` or `false` | -| `"response": {` | field regarding response information | -|   `"bytes"` | response body size in bytes | -|   `"headers" }` | field regarding keys and values originating from configured keys/header names | -| `"server"` | server name (defined in couper file) | -| `"status"` | response status code, see [Mozilla HTTP Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status) for more information | -| `"timings": {` | field regarding timing | -|   `"total" }` | total time taken | -| `“uid"` | unique request id configurable in [Settings](./REFERENCE.md#settings-block) | -| `"url"` | complete url (`://:` or ``) | +| Name | | Description | +| :------------ | :---------- | :-------------------------------------------------------------------------------------------------------------------------------- | +| `"auth_user"` | | basic auth username (if provided) | +| `"client_ip"` |  | ip of client | +| `"endpoint"` |  | path pattern of endpoint | +| `"handler"` |  | one of: `endpoint`, `file`, `spa` | +| `"method"` |  | http request method, see [Mozilla HTTP Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods) for more information | +| `"port"` |  | current port accepting request | +| `"request":` | | field regarding request information | +| | `{` | | +| | `"bytes"` | request body size in bytes | +| | `"headers"` | field regarding keys and values originating from configured keys/header names | +| | `"host"` | request host | +| | `"method"` | http request method, see [Mozilla HTTP Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods) for more information | +| | `"origin"` | request origin (`://:`), for our purposes excluding `://` in printing, see [Mozilla HTTP Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Origin) for more information | +| | `"path"` | request path | +| | `"proto"` | request protocol | +| | `"status"` | request status code, see [Mozilla HTTP Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status) for more information | +| | `"tls"` | TLS used `true` or `false` | +| | `}` | | +| `"response":` | | field regarding response information | +| | `{` | | +| | `"bytes"` | response body size in bytes | +| | `"headers"` | field regarding keys and values originating from configured keys/header names | +| | `}` | | +| `"server"` | | server name (defined in couper file) | +| `"status"` |  | response status code, see [Mozilla HTTP Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status) for more information | +| `"timings":` | | field regarding timing | +| | `{` | | +| | `"total"` | total time taken | +| | `)` | | +| `“uid"` | | unique request id configurable in [Settings](./REFERENCE.md#settings-block) | +| `"url"` | | complete url (`://:` or ``) | ### Backend Fields These fields are found in the [Log Type](#log-types) `couper_backend` in addition to the [Common Fields](#common-fields). -| Name | Description | -| :----------------------- | :-------------------------------------------------------------------------------------------------------------------------------- | -| `"auth_user"` | backend request basic auth username (if provided) | -| `"backend"` | configured name, `default` if not provided | -| `"method"` | http request method, see [Mozilla HTTP Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods) for more information | -| `"proxy"` | used system proxy url (if configured), see [Proxy Block](./REFERENCE.md#proxy-block) | -| `"request": {` | field regarding request information | -|   `"bytes"` | request body size in bytes | -|   `"headers"` | field regarding keys and values originating from configured keys/header names | -|   `"host"` | request host | -|   `"method"` | http request method, see [Mozilla HTTP Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods) for more information | -|   `"name"` | configured request name, `default` if not provided | -|   `"origin"` | request origin, for our purposes excluding `://` in printing, see [Mozilla HTTP Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Origin) for more information | -|   `"path"` | request path | -|   `"port"` | current port accepting request | -|   `"proto" }` | request protocol | -| `"response": {` | field regarding response information | -|   `"headers"` | field regarding keys and values originating from configured keys/header names | -|   `"status" }` | response status code, see [Mozilla HTTP Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status) for more information | -| `"status"` | response status code, see [Mozilla HTTP Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status) for more information | -| `"timings": {` | field regarding timing | -|   `"dns"` | time taken by dns | -|   `"tcp"` | time taken between attempting and establishing tcp connection | -|   `"tls"` | time taken between attempt and success at tls handshake | -|   `"total"` | total time taken | -|   `"ttfb" }` | time to first byte/between establishing connection and receiving first byte | -| `"token_request"` | entry regarding request for token | -| `"token_request_retry"` | how many `token_request` attempts were made | -| `"uid"` | unique request id configurable in [Settings](./REFERENCE.md#settings-block) | -| `"url"` | complete url (`://:` or ``) | -| `"validation"` | validation result for open api, see [OpenAPI Block](./REFERENCE.md#openapi-block) | +| Name | | Description | +| :---------------------- | :---------- | :-------------------------------------------------------------------------------------------------------------------------------- | +| `"auth_user"` |  | backend request basic auth username (if provided) | +| `"backend"` |  | configured name, `default` if not provided | +| `"method"` |  | http request method, see [Mozilla HTTP Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods) for more information | +| `"proxy"` | | used system proxy url (if configured), see [Proxy Block](./REFERENCE.md#proxy-block) | +| `"request":` | | field regarding request information | +| | `{` | | +| | `"bytes"` | request body size in bytes | +| | `"headers"` | field regarding keys and values originating from configured keys/header names | +| | `"host"` | request host | +| | `"method"` | http request method, see [Mozilla HTTP Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods) for more information | +| | `"name"` | configured request name, `default` if not provided | +| | `"origin"` | request origin, for our purposes excluding `://` in printing, see [Mozilla HTTP Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Origin) for more information | +| | `"path"` | request path | +| | `"port"` | current port accepting request | +| | `"proto"` | request protocol | +| | `}` | | +| `"response":` | | field regarding response information | +| | `{` | | +| | `"headers"` | field regarding keys and values originating from configured keys/header names | +| | `"status"` | response status code, see [Mozilla HTTP Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status) for more information | +| | `}` | | +| `"status"` | | response status code, see [Mozilla HTTP Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status) for more information | +| `"timings":` | | field regarding timing | +| | `{` | | +| | `"dns"` | time taken by dns | +| | `"tcp"` | time taken between attempting and establishing tcp connection | +| | `"tls"` | time taken between attempt and success at tls handshake | +| | `"total"` | total time taken | +| | `"ttfb"` | time to first byte/between establishing connection and receiving first byte | +| | `)` | | +| `"token_request"` |  | entry regarding request for token | +| `"token_request_retry"` |  | how many `token_request` attempts were made | +| `"uid"` | | unique request id configurable in [Settings](./REFERENCE.md#settings-block) | +| `"url"` | | complete url (`://:` or ``) | +| `"validation"` | | validation result for open api, see [OpenAPI Block](./REFERENCE.md#openapi-block) | ### Daemon Fields These fields are found in the [Log Type](#log-types) `couper_daemon` in addition to the [Common Fields](#common-fields). -| Name | Description | -| :---------------------------- | :------------------------------------------------------------------------------------------------------------------------- | -| `"deadline"` | shutdown parameter, see [Health-Check](./REFERENCE.md#health-check) | -| `"delay"` | shutdown parameter, see [Health-Check](./REFERENCE.md#health-check) | -| `"watch": {` | field watching configuration file changes, logs with this field only appear if `watch=true`, more in [Settings](#settings) | -|   `"max-retries",` | maximum retry count, see [Global Options](./CLI.md#global-options) | -|   `"retry-delay" }` | configured delay of each retry, see [Global Options](./CLI.md#global-options) | +| Name | | Description | +| :----------- | :-------------- | :------------------------------------------------------------------------------------------------------------------------- | +| `"deadline"` | | shutdown parameter, see [Health-Check](./REFERENCE.md#health-check) | +| `"delay"` | | shutdown parameter, see [Health-Check](./REFERENCE.md#health-check) | +| `"watch":` | | field watching configuration file changes, logs with this field only appear if `watch=true`, more in [Settings](#settings) | +| | `{` | | +| | `"max-retries"` | maximum retry count, see [Global Options](./CLI.md#global-options) | +| | `"retry-delay"` | configured delay of each retry, see [Global Options](./CLI.md#global-options) | +| | `)` | | ## Settings