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

rolling does not work? #16

Closed
wangjiepower opened this issue Oct 10, 2022 · 6 comments
Closed

rolling does not work? #16

wangjiepower opened this issue Oct 10, 2022 · 6 comments
Labels

Comments

@wangjiepower
Copy link

run examples , found that when temp.log reach the max temp size , it will be cleared ,but no rolled file generated?

@zhuxiujia
Copy link
Member

run examples , found that when temp.log reach the max temp size , it will be cleared ,but no rolled file generated?

yes,it will be create rolling files

@wangjiepower
Copy link
Author

i mean ,for example ,use LZ4Packer , there were no rolling compressed files in the target/logs/ directory

use fast_log::config::Config;
use fast_log::consts::LogSize;
use fast_log::plugin::file_split::RollingType;
use fast_log::plugin::packer::LZ4Packer;


fn main() {
        fast_log::init(Config::new().console().file_split(
                "target/logs/",
                LogSize::KB(5),
                RollingType::KeepNum(5),
                LZ4Packer {},
                ))
                .unwrap();
        for _ in 0..2000000 {
             log::info!("Commencing yak shaving");
        }
        log::logger().flush();
        println!("you can see log files in path: {}", "target/logs/")
}

@zhuxiujia
Copy link
Member

i mean ,for example ,use LZ4Packer , there were no rolling compressed files in the target/logs/ directory

use fast_log::config::Config;
use fast_log::consts::LogSize;
use fast_log::plugin::file_split::RollingType;
use fast_log::plugin::packer::LZ4Packer;


fn main() {
        fast_log::init(Config::new().console().file_split(
                "target/logs/",
                LogSize::KB(5),
                RollingType::KeepNum(5),
                LZ4Packer {},
                ))
                .unwrap();
        for _ in 0..2000000 {
             log::info!("Commencing yak shaving");
        }
        log::logger().flush();
        println!("you can see log files in path: {}", "target/logs/")
}

I tried the code and it worked and produced five temp2022-10-10T21-47-54-950524.lz4 files

@wangjiepower
Copy link
Author

wangjiepower commented Oct 11, 2022

I tried on centos it worked , windows does not work

@namespaceYcZ
Copy link

It does not work on windows.

zhuxiujia added a commit that referenced this issue Oct 28, 2022
zhuxiujia added a commit that referenced this issue Oct 28, 2022
zhuxiujia added a commit that referenced this issue Oct 28, 2022
zhuxiujia added a commit that referenced this issue Oct 28, 2022
@zhuxiujia
Copy link
Member

this fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants