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

add log-rotate function on windows #34265

Closed
derek0377 opened this issue Jun 24, 2016 · 10 comments
Closed

add log-rotate function on windows #34265

derek0377 opened this issue Jun 24, 2016 · 10 comments
Labels
Pending-Discussion The issue or pull request needs more discussion before it can be closed or merged stale
Milestone

Comments

@derek0377
Copy link

linux can rotate log easily, windows not,so would you support rotate log?
I see code:
https://github.com/saltstack/salt/blob/develop/salt/log/setup.py#L639
function setup_logfile_logger:
handler = WatchedFileHandler(log_path, mode='a', encoding='utf-8', delay=0)

if config logrotate, then change to:
handler = RotatingFileHandler(log_path, maxBytes=config.maxBytes,backupCount=configy.backupCount) that will work as I do on my own environment.

Other need is adding that code and add conf in config.py,
That really helps a lot on windows platform as log-rotate is hard on windows-self.
So would you support it? Thanks

@Ch3LL
Copy link
Contributor

Ch3LL commented Jun 24, 2016

ping @twangboy do you think it would be possible to implement something like this?

@Ch3LL Ch3LL added the Pending-Discussion The issue or pull request needs more discussion before it can be closed or merged label Jun 24, 2016
@Ch3LL Ch3LL added this to the Blocked milestone Jun 24, 2016
@twangboy
Copy link
Contributor

@Ch3LL Is this a feature. Does Linux handle the logs automatically? How would this affect Linux?

@damon-atkins
Copy link
Contributor

#26195 See this thread started in 2015 this is a duplicate

@stale
Copy link

stale bot commented May 26, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue.

@stale stale bot added the stale label May 26, 2018
@stale stale bot closed this as completed Jun 2, 2018
@marbx
Copy link
Contributor

marbx commented Apr 5, 2019

I need this feature.

@marbx
Copy link
Contributor

marbx commented Apr 5, 2019

Pleasse reopen and suggest a solution. Thank you

@twangboy
Copy link
Contributor

twangboy commented Apr 8, 2019

I think this is handled for Salt logs with log_rotate_max_bytes and log_rotate_backup_count
https://docs.saltstack.com/en/latest/ref/configuration/minion.html#log-rotate-max-bytes

Unless you're talking about the actual Windows logs...

@marbx
Copy link
Contributor

marbx commented Apr 16, 2019

Thank you - these settings would be a solution.

Only that on a 2016.11.3 minion, from these 3 settings only the level takes effect:
log_level_logfile: debug
log_rotate_max_bytes: 1200
log_rotate_backup_count: 3

@twangboy
Copy link
Contributor

Looks like those options were added in 2017.7.

@marbx
Copy link
Contributor

marbx commented Apr 16, 2019

On a 2018.3.3 client: very nice log file rotation :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Pending-Discussion The issue or pull request needs more discussion before it can be closed or merged stale
Projects
None yet
Development

No branches or pull requests

5 participants