Skip to content

Commit

Permalink
Add config setting for c8y.enable.log_management
Browse files Browse the repository at this point in the history
Till c8y-log-plugin is deprecated, one has to explicitly turn on the log
management capability before starting the mapper.

```
$ sudo tedge config set c8y.enable.log_management true
$ tegde-mapper c8y &
$ tedge-log-plugin &
```

Signed-off-by: Didier Wenzek <didier.wenzek@free.fr>
  • Loading branch information
didier-wenzek committed Sep 1, 2023
1 parent 858c6c2 commit 69e0e72
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,13 @@ define_tedge_config! {
#[tedge_config(default(value = "te/+/+/+/+/m/+,tedge/alarms/+/+,tedge/alarms/+/+/+,tedge/events/+,tedge/events/+/+,tedge/health/+,tedge/health/+/+"))]
topics: TemplatesSet,

enable: {
/// Enable log management
// TODO turn the default to true, when c8y-log-plugin will be deprecated
#[tedge_config(example = "true", default(value = false))]
log_management: bool,
}

},

#[tedge_config(deprecated_name = "azure")] // for 0.1.0 compatibility
Expand Down
5 changes: 3 additions & 2 deletions crates/extensions/c8y_mapper_ext/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,9 @@ impl C8yMapperConfig {

let tedge_http_host = format!("{}:{}", tedge_http_address, tedge_http_port);

// TODO read these capabilities from disk
let capabilities = Capabilities::default();
let capabilities = Capabilities {
log_management: tedge_config.c8y.enable.log_management,
};

let mut topics = Self::default_internal_topic_filter(&config_dir)?;

Expand Down

0 comments on commit 69e0e72

Please sign in to comment.