Logging to file for windows service


I have a random issue where the windows service stops responding to http connections, and only a reboot seems to fix it even after stopping all the processes. What would be nice is to have the service logging to a log file so I can see what’s possibly going wrong.

How do I set the service to log to a text file? I tried adding --logging-file to the command line of the service but all it did was loop the process, it would stop/start constantly.