Windows Service output

后端 未结 1 1907
清酒与你
清酒与你 2021-01-01 21:32

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 appli

相关标签:
1条回答
  • 2021-01-01 22:26

    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).
    0 讨论(0)
提交回复
热议问题