Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: logging component #1113

Merged
merged 2 commits into from
Mar 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions docs/configurations/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,15 @@ proxy configuration, and logging level configuration.
| restHandlerClass | string | TBD |
| customTab | Object | This property allows you to enable the [custom tab](../custom_ui_extensions/custom_tab.md) feature. |

### Tab components

Instead of specifying a tab from scratch with above fields, you can add a predefined
tab.

Currently available tab components:

- [Logging tab](./logging.md)

### Usage

```json
Expand All @@ -49,6 +58,9 @@ proxy configuration, and logging level configuration.
"options": {
"saveValidator": ""
}
},
{
"type": "loggingTab"
}
]
}
Expand Down
62 changes: 62 additions & 0 deletions docs/configurations/logging.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
The logging tab is a predefined component that allows to create the page for changing
the log level. It is added in the `pages.configuration.tabs` array

![image](../images/configuration/logging_tab.png)

### Minimal definition

```json
{
"type": "loggingTab"
}
```

This creates the tab seen in the image above with log levels:
DEBUG, INFO, WARNING, ERROR, CRITICAL. INFO is the default level.
The value is saved in `loglevel` config parameter.

### Usage

It is placed just like every other configuration tab.

```json
{
"pages": {
"configuration": {
"tabs": [
{
"type": "loggingTab"
}
],
"title": "Configuration",
"description": "..."
}
}
}
```

### Optional Fields

| Field Name | Description |
|--------------|-------------------------------------------------------------------------------------------------|
| name | Tab name. Default is `logging` |
| title | Tab title. Default is `Logging` |
| label | Label text displayed next to the log level dropdown. Default is `Log level` |
| field | Configuration field name. Default is `loglevel` |
| levels | List of all possible log levels. Default is `["DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"]` |
| defaultLevel | Default log level at the beginning. Default is `INFO` |

### Example

```json
{
"type": "loggingTab",
"name": "logging_other",
"title": "Logging other",
"label": "Log level",
"field": "loglevel",
"levels": ["DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"],
"defaultLevel": "INFO"
}
```

Binary file added docs/images/configuration/logging_tab.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ nav:
- Configuration:
- "configurations/index.md"
- Introduction: "configurations/index.md"
- Logging: "configurations/logging.md"
- Proxy: "configurations/proxy.md"
- Dashboard: "dashboard.md"
- Entity:
Expand Down
Loading