Search code examples
c#consoleoutputtopshelf

Disable Topshelf console output


When calling HostConfigurator.RunAsLocalSystem() or equivalent, the TopShelf library outputs several lines to the console.

How to I prevent TopShelf from outputing these lines?


Solution

  • The console output is logging information. If you use a logging framework with Topshelf the lines appear in log files instead of the console.

    I recommend using a logging framework with Topshelf. You should always be logging in a serious project anyway, and it eliminates the lines from the console. Win/win.