#Tauri plugin log multiple targets

4 messages · Page 1 of 1 (latest)

formal grove
#

How can I make it log to LogDir, Webview and Stdout all at the same time?

lime wharf
#

would you mind opening an issue about this on the tauri-docs repo?

formal grove
# lime wharf you can call .target() multiple times: <https://github.com/tauri-apps/plugins-wo...

I see, I was doing

.plugin(tauri_plugin_log::Builder::new().target(tauri_plugin_log::Target::new(
            tauri_plugin_log::TargetKind::LogDir {
              file_name: Some("logs".to_string()),
            },
          )).target(tauri_plugin_log::Target::new(
            tauri_plugin_log::TargetKind::Webview,
          )).target(tauri_plugin_log::Target::new(
            tauri_plugin_log::TargetKind::Stdout,
          )).build())

not

.plugin(tauri_plugin_log::Builder::new().targets([
            Target::new(TargetKind::LogDir { file_name: Some("logs".to_string()) }),
            Target::new(TargetKind::Webview),
            Target::new(TargetKind::Stdout),
        ]).build())