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

Support for logrotate on windows machines #451

Open
bdrepaul opened this issue Dec 24, 2016 · 4 comments
Open

Support for logrotate on windows machines #451

bdrepaul opened this issue Dec 24, 2016 · 4 comments
Labels
Type: Enhancement Adds new functionality.

Comments

@bdrepaul
Copy link

bdrepaul commented Dec 24, 2016

Cookbook version

7.0.0

Chef-client version

Chef 12.17.44

Platform Details

Windows 2008 R2/Windows 2012 R2

Scenario:

I am facing an issue where my logs are 300 MB in size and I need to manually clean them up. I see that logrotate is not supported on Windows but it is for *nix

Steps to Reproduce:

Let the cookbook execute for sometime and the log c:\chef\client.log will continue to grow in size

Expected Result:

Can this be a future feature.

Actual Result:

N/A

@bdrepaul bdrepaul changed the title logrotate for windows machines Support for logrotate on windows machines Dec 24, 2016
@jugatsu
Copy link
Contributor

jugatsu commented Apr 16, 2017

@bdrepaul you can use :win_evt to log directly to windows eventlog.

@iennae
Copy link
Contributor

iennae commented May 16, 2017

@bdrepaul does logging to windows event log work for you?

@haidangwa
Copy link

haidangwa commented Jul 12, 2017

We would like to have log rotation of the log file instead of using Windows Event Log. There is a lot of extra noise in the Event Log that most of our SE's that use chef tend to not prefer looking there. In our case, we have wrapped and extended the chef-client cookbook with our own log rotation mechanism using a Scheduled Task that runs a powershell script. The script saves the old log file and resets the filename specified in the client.rb to one that is timestamped. The script also handles deleting old log files.

Since the chef-client handles log rotation on Linux nodes that we have, our expectation is to have parity on Windows, as well.

@tas50 tas50 added Type: Enhancement Adds new functionality. and removed Type: Feature Request labels Jan 4, 2019
@JoelMiller74
Copy link

Is there any update on this? The comment made by @haidangwa sums up my feelings on this as well.
@haidangwa , do you have this wrapper cookbook available for others to look at? This feels like a good option until something is baked into the product.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement Adds new functionality.
Development

No branches or pull requests

6 participants