Service Logging Considerations

2 min read

2 min read

2 min read

2 min read

2 min read

2 min read

2 min read

2 min read

2 min read

An Ice service running as a Windows service logs to the Windows event log by default. The event source is the service's name unless you set Ice.EventLog.Source. The Ice service installer registers this source in the Application log unless you set its EventLog property.

On Linux and macOS, an Ice service logs to standard error by default. A service managed by systemd or launchd runs in the foreground: systemd collects this output in its journal, and launchd writes it to the file named by the StandardErrorPath key of the job's property list, or discards it when this key is not set. To send the log messages elsewhere:

A service started with --daemon discards standard error unless Ice.StdErr is set or --noclose is passed.

An Ice service creates the logger that its configuration selects when it initializes its communicator. It reports errors that occur before then to standard error on Linux and macOS, and on Windows when it runs without --service.

A Windows service reports these errors to the event log, except an error reading its configuration file: the service reads this file before it opens the event log, so this error goes to standard error.