Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Windows Service output

Tags:

windows

What happens to messages printed to stdout and stderr from a Windows service? I know they're not going anywhere, but do they go down /dev/null? Is it possible that an application will block during such a write ?

like image 605
Tom Avatar asked Dec 11 '13 15:12

Tom


People also ask

What is difference between Windows Service and worker?

Windows Services have existed for over 20 years. They start most often at system startup and run permanently. A Worker Service is also a real process, but is intended as a background service for a front-end application; it starts with the application and stops with the application.

What is Windows Service in C#?

A Windows service is a long-running application that can be started automatically when your system is started. You can pause your service and resume or even restart it if need be. Once you have created a Windows service, you can install it in your system using the InstallUtil.exe command line utility.


1 Answers

The output will effectively go to dev/null, and won't introduce a blocking issue. Now performance on the other-hand will be impacted, as it does take resources to write it out.

Ideally, you would be able to configure where logs end up. A nicely implemented service will allow for:

  • Writting logs to one or more of: a file, debug output, console output (when running local instances for testing/debugging), potentially even a database.
  • Ability to specify the path to where log files are written.
  • Configure how long logs are kept around (the service should be able to purge older logs to prevent HDD leaks)
  • Specify how frequently to start a new file (so you don't end up with 18 gigabyte log files).
  • Ideally, you also want the ability to configure how much data to log (what level of detail).
like image 178
josh poley Avatar answered Oct 03 '22 19:10

josh poley