Skip to content

add component based log level config for icingadb #369

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
3 changes: 3 additions & 0 deletions changelogs/fragments/icingadb-component-loglevel-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
minor_changes:
- provide component based log level setting in icingadb
19 changes: 17 additions & 2 deletions doc/role-icingadb/role-icingadb.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,27 @@ For more information on the respective settings please see [the official documen

### Logging configuration

For logging, currently only the **logging level** can be set. The default is `info`:

| Variable | Type | Description | Default |
|----------|------|-------------|---------|
| `icingadb_logging_level` | `fatal\|error\|warn\|info\|debug` | Defines the logging level for IcingaDB. | `info` |

#### Compont based log level
The following variables can be used to define special log levels for individual components.

| Variable | Type | Description | Default |
|----------|------|-------------|---------|
| `icingadb_log_level_confic_sync` | `fatal\|error\|warn\|info\|debug` | log-level for component `config-sync` | value from `icingadb_logging_level`, `info` by default |
| `icingadb_log_level_database` | `fatal\|error\|warn\|info\|debug` | log-level for component `database` | value from `icingadb_logging_level`, `info` by default |
| `icingadb_log_level_dumps_ignals` | `fatal\|error\|warn\|info\|debug` | log-level for component `dump-signals` | value from `icingadb_logging_level`, `info` by default |
| `icingadb_log_level_confic_sync` | `fatal\|error\|warn\|info\|debug` | log-level for component `heartbeat` | value from `icingadb_logging_level`, `info` by default |
| `icingadb_log_level_high_availability` | `fatal\|error\|warn\|info\|debug` | log-level for component `high-availability` | value from `icingadb_logging_level`, `info` by default |
| `icingadb_log_level_history_sync` | `fatal\|error\|warn\|info\|debug` | log-level for component `history-sync` | value from `icingadb_logging_level`, `info` by default |
| `icingadb_log_level_overdue_sync` | `fatal\|error\|warn\|info\|debug` | log-level for component `overdue-sync` | value from `icingadb_logging_level`, `info` by default |
| `icingadb_log_level_redis` | `fatal\|error\|warn\|info\|debug` | log-level for component `redis` | value from `icingadb_logging_level`, `info` by default |
| `icingadb_log_level_retention` | `fatal\|error\|warn\|info\|debug` | log-level for component `retention` | value from `icingadb_logging_level`, `info` by default |
| `icingadb_log_level_runtime_updates` | `fatal\|error\|warn\|info\|debug` | log-level for component `runtime-updates` | value from `icingadb_logging_level`, `info` by default |
| `icingadb_log_level_telemetry` | `fatal\|error\|warn\|info\|debug` | log-level for component `telemetry` | value from `icingadb_logging_level`, `info` by default |

### IcingaDB Retention

| Variable | Type | Description | Default |
Expand Down
44 changes: 33 additions & 11 deletions roles/icingadb/templates/icingadb.ini.j2
Original file line number Diff line number Diff line change
Expand Up @@ -69,17 +69,39 @@ logging:

# Map of component-logging level pairs to define a different log level than the default value for each component.
options:
# config-sync:
# database:
# dump-signals:
# heartbeat:
# high-availability:
# history-sync:
# overdue-sync:
# redis:
# retention:
# runtime-updates:
# telemetry:
{% if icingadb_log_level_confic_sync is defined and icingadb_log_level_confic_sync in ['fatal','error','warn','info','debug'] %}
config-sync: {{ icingadb_log_level_confic_sync }}
{% endif %}
{% if icingadb_log_level_database is defined and icingadb_log_level_database in ['fatal','error','warn','info','debug'] %}
database: {{ icingadb_log_level_database }}
{% endif %}
{% if icingadb_log_level_dumps_ignals is defined and icingadb_log_level_dumps_ignals in ['fatal','error','warn','info','debug'] %}
dump-signals: {{ icingadb_log_level_dumps_ignals }}
{% endif %}
{% if icingadb_log_level_heartbeat is defined and icingadb_log_level_heartbeat in ['fatal','error','warn','info','debug'] %}
heartbeat: {{ icingadb_log_level_heartbeat }}
{% endif %}
{% if icingadb_log_level_high_availability is defined and icingadb_log_level_high_availability in ['fatal','error','warn','info','debug'] %}
high-availability: {{ icingadb_log_level_high_availability }}
{% endif %}
{% if icingadb_log_level_history_sync is defined and icingadb_log_level_history_sync in ['fatal','error','warn','info','debug'] %}
history-sync: {{ icingadb_log_level_history_sync }}
{% endif %}
{% if icingadb_log_level_overdue_sync is defined and icingadb_log_level_overdue_sync in ['fatal','error','warn','info','debug'] %}
overdue-sync: {{ icingadb_log_level_overdue_sync }}
{% endif %}
{% if icingadb_log_level_redis is defined and icingadb_log_level_redis in ['fatal','error','warn','info','debug'] %}
redis: {{ icingadb_log_level_redis }}
{% endif %}
{% if icingadb_log_level_retention is defined and icingadb_log_level_retention in ['fatal','error','warn','info','debug'] %}
retention: {{ icingadb_log_level_retention }}
{% endif %}
{% if icingadb_log_level_runtime_updates is defined and icingadb_log_level_runtime_updates in ['fatal','error','warn','info','debug'] %}
runtime-updates: {{ icingadb_log_level_runtime_updates }}
{% endif %}
{% if icingadb_log_level_telemetry is defined and icingadb_log_level_telemetry in ['fatal','error','warn','info','debug'] %}
telemetry: {{ icingadb_log_level_telemetry }}
{% endif %}

# Retention is an optional feature to limit the number of days that historical data is available,
# as no historical data is deleted by default.
Expand Down