Mandar's blog about .Net & PHP Web Development

  • Archive
  • RSS

log files rotator for nginx on windows

nginx log file on windows server

I wrote this code for rotating nginx log file on windows server. I installed nginx as windows service to serve loads of static content hence it writes lots of entries in log files. So i wrote this code to stop nginx for few seconds, move log files to new location and then restart it.

It requires .NET 3.5, Log4net and file called service.config (which has config details for log rotator)

Installation steps :

1> Copy service.config in same directory as windowslogrotator.exe files
2> Configure WindowsLogRotator.exe.config (app.config) with log4net config
3> Install windowslogrotator.exe as windows service using installutil
4> Enjoy

No guarantees whatsoever. Use at your own risk ;)

View the code here : http://paste2.org/p/1411838 or Download Visual Studio solution code + prebuilt binary

    • #nginx nginx_logfile
  • 1 year ago
  • Permalink
  • Share
    Tweet
← Previous • Next →

Get 2GB Free Cloud storage

>> Download dropbox


About

I am programmer from London specializing in web based technologies, startups and web 2.0 related stuff.

My Startup

WealthBird

Available for Freelancing work

I am available for .NET contracting work in & around London. Drop me a mail : mandarp1979 at gmail.com

  • RSS
  • Random
  • Archive
  • Mobile

Effector Theme by Carlo Franco.

Powered by Tumblr