How to capture console output from a service C#?

后端 未结 7 1578
无人及你
无人及你 2021-02-07 06:12

We have a C# service that is deployed to a remote customer system. The application writes a substantial amount of \"diagnostic\" information to the console (i.e. Console.WriteL

7条回答
  •  既然无缘
    2021-02-07 06:41

    I wouldn't use Console.WriteLine at all from a Window Service. You should probably log these errors to a log file.

    Another way of doing this so that multiple applications can consume the logs is posting the log messages to a MSMQ queue.

提交回复
热议问题