|
2 | 2 | icon: material/script-text |
3 | 3 | --- |
4 | 4 |
|
5 | | -TODO |
| 5 | +Under the `logging` config option the logging behavior and locations can be |
| 6 | +configured. |
| 7 | + |
| 8 | +## `access` |
| 9 | +<span class="badge badge-purple" title="Value Type">object</span> |
| 10 | +<span class="badge badge-green" title="If this option is required or optional">recommended</span> |
| 11 | + |
| 12 | +Under the `access` option the http access log can be configured. |
| 13 | + |
| 14 | +??? file "config.yaml" |
| 15 | + |
| 16 | + ```yaml |
| 17 | + logging: |
| 18 | + access: |
| 19 | + dir: /var/log/offa |
| 20 | + stderr: true |
| 21 | + ``` |
| 22 | + |
| 23 | +The following options are available: |
| 24 | + |
| 25 | +### `dir` |
| 26 | +<span class="badge badge-purple" title="Value Type">directory path</span> |
| 27 | +<span class="badge badge-green" title="If this option is required or optional">optional</span> |
| 28 | + |
| 29 | +The `dir` option is used to configure the directory where the log file |
| 30 | +should be stored. |
| 31 | +If not set, OFFA will not log to file. |
| 32 | + |
| 33 | +### `stderr` |
| 34 | +<span class="badge badge-purple" title="Value Type">boolean</span> |
| 35 | +<span class="badge badge-blue" title="Default Value">`false`</span> |
| 36 | +<span class="badge badge-green" title="If this option is required or optional">optional</span> |
| 37 | + |
| 38 | +The `stderr` option indicates if OFFA logs to `stderr`. |
| 39 | + |
| 40 | +## `internal` |
| 41 | +The `internal` option is used to configure logging for OFFA's internal |
| 42 | +logging, i.e. logging related to what OFFA does. |
| 43 | + |
| 44 | +??? file "config.yaml" |
| 45 | + |
| 46 | + ```yaml |
| 47 | + logging: |
| 48 | + internal: |
| 49 | + dir: /var/log/offa |
| 50 | + stderr: true |
| 51 | + level: info |
| 52 | + smart: |
| 53 | + enabled: true |
| 54 | + dir: /var/log/offa/errors |
| 55 | + ``` |
| 56 | + |
| 57 | +All configuration options from [`access`](#access) also can be used with |
| 58 | +`internal`. |
| 59 | +In additional the following options can be used: |
| 60 | + |
| 61 | +### `level` |
| 62 | +<span class="badge badge-purple" title="Value Type">enum</span> |
| 63 | +<span class="badge badge-blue" title="Default Value">info</span> |
| 64 | +<span class="badge badge-green" title="If this option is required or optional">optional</span> |
| 65 | + |
| 66 | +The `level` option sets the minimal log level that should be logged. |
| 67 | + |
| 68 | +Valid values are: |
| 69 | + |
| 70 | +- `trace` |
| 71 | +- `debug` |
| 72 | +- `info` |
| 73 | +- `warn` / `warning` |
| 74 | +- `error` |
| 75 | +- `fatal` |
| 76 | +- `panic` |
| 77 | + |
| 78 | +### `smart` |
| 79 | + |
| 80 | +Under the `smart` option 'smart' logging can be enabled and configured. |
| 81 | +Smart logging allows to have a higher (less verbose) log level set for |
| 82 | +general (internal) logging without loosing valuable debug information in |
| 83 | +case errors occure. |
| 84 | + |
| 85 | +If smart logging is enabled, the general logs are still done with the level |
| 86 | +set through the [`level`](#level) option, but if an error occurs a special |
| 87 | +error log is created to a dedicated file. This dedicated error log contains |
| 88 | +all log entries - including all log levels, also levels that normally woud |
| 89 | +not be logged - for that particular request. |
| 90 | + |
| 91 | +#### `enabled` |
| 92 | +<span class="badge badge-purple" title="Value Type">boolean</span> |
| 93 | +<span class="badge badge-blue" title="Default Value">`false`</span> |
| 94 | +<span class="badge badge-green" title="If this option is required or optional">optional</span> |
| 95 | + |
| 96 | +The `enabled` option is used to enable smart logging. |
| 97 | + |
| 98 | +#### `dir` |
| 99 | +<span class="badge badge-purple" title="Value Type">directory path</span> |
| 100 | +<span class="badge badge-blue" title="Default Value">same as the internal logging dir</span> |
| 101 | +<span class="badge badge-green" title="If this option is required or optional">optional</span> |
| 102 | + |
| 103 | +The `dir` option is used to specify the directory where smart error log |
| 104 | +files should be stored. |
| 105 | +If not set and smart logging is enabled, smart error logs are placed in the |
| 106 | +same directory as the regular internal log file. |
0 commit comments