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

How To Limit The Max Ram Buffer #35

Open
SohamTilekar opened this issue Jul 29, 2024 · 3 comments
Open

How To Limit The Max Ram Buffer #35

SohamTilekar opened this issue Jul 29, 2024 · 3 comments
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@SohamTilekar
Copy link

SohamTilekar commented Jul 29, 2024

How Can I Limit the Maxim Ram Buffer.

@SohamTilekar SohamTilekar changed the title Writing To File from Different Thread Instead of the Writing at the End of the Program Termination. How To Limit The Max Ram Buffer Jul 29, 2024
@zhuxiujia
Copy link
Member

zhuxiujia commented Jul 29, 2024

Our logger currently writes logs to a file only at program termination, risking log loss if the program crashed By External Events. We propose modifying the logger to write logs in real-time from a separate thread, ensuring logs are preserved and immediately available.

  • This Create the Memory Overhead, It Stores the Log in the RAM Which can Overflow the Ram.

did you call log::logger().flush(); method?

@zhuxiujia zhuxiujia added good first issue Good for newcomers help wanted Extra attention is needed labels Jul 29, 2024
@zhuxiujia
Copy link
Member

zhuxiujia commented Jul 29, 2024

How Can I Limit the Maxim Ram Buffer.

did you use fast_log::init(Config::new().console().chan_len(Some(100000))).unwrap(); to limit Maxim Ram Buffer?

@SohamTilekar
Copy link
Author

Our logger currently writes logs to a file only at program termination, risking log loss if the program crashed By External Events. We propose modifying the logger to write logs in real-time from a separate thread, ensuring logs are preserved and immediately available.

  • This Create the Memory Overhead, It Stores the Log in the RAM Which can Overflow the Ram.

did you call log::logger().flush(); method?

But This Can Be Done Automatically in Background Thread with Little to No Overhead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants