plugins-workspace icon indicating copy to clipboard operation
plugins-workspace copied to clipboard

[log] LogTarget::Folder max_file_size does not affect

Open 8012311 opened this issue 2 years ago • 4 comments

builder.plugin(
                tauri_plugin_log::Builder::default()
                    .max_file_size(100)
                    .targets([LogTarget::Folder(&path)])
                    .rotation_strategy(RotationStrategy::KeepAll)
                    .level(LevelFilter::Debug)
                    .build(),
            );

the log file becomes ~1500 KB but still write there - no *.bac file created

8012311 avatar Nov 08 '23 09:11 8012311

Any News?

yansenlei avatar Mar 26 '24 06:03 yansenlei

+1. This still seems to be an issue. In my case, I notice that the log file size can grow beyond the configured max_file_size while the app is still running. However, when I close and re-open the app, it will rotate the log file if it has grown beyond the limit. Would it be possible to add live rotations?

mlbishop avatar Jan 15 '25 19:01 mlbishop

This is happening to me too. Any updates on this?

blim8183 avatar Apr 15 '25 22:04 blim8183

+1.

tauri_plugin_log::Builder::new()
                .target(tauri_plugin_log::Target::new(
                    tauri_plugin_log::TargetKind::LogDir { file_name: None },
                ))
                .max_file_size(50* 1024) 
                .rotation_strategy(tauri_plugin_log::RotationStrategy::KeepAll) 
                .level(log::LevelFilter::Error) 
                .timezone_strategy(tauri_plugin_log::TimezoneStrategy::UseLocal)
                .build()

I use log = "0.4.27" and "@tauri-apps/plugin-fs": "^2.2.0"

JungleHH avatar Apr 21 '25 10:04 JungleHH