Built-in Loggers
2 min read
2 min read
2 min read
2 min read
Ice provides a file logger and, depending on the language mapping and platform, loggers that write to a system logging service. You select one of these loggers with properties.
File Logger
Setting the Ice.LogFile property selects the file-based logger in Node.js. This logger appends its messages to the specified file and creates the file if necessary.
Ice.LogFile.SizeMax enables log file rotation: when the log file reaches the configured size, the file logger archives it under a new name and starts a new file.
Syslog Logger
On Linux and macOS, you can activate a logger that logs via the Unix syslog implementation by setting Ice.UseSyslog to 1.
Systemd Journal Logger
On Linux, you can activate a logger that logs to the systemd journal by setting Ice.UseSystemdJournal to 1. This logger is available only when Ice is built with systemd support.
OSLog Logger
On macOS and iOS, you can activate a logger that logs using OSLog by setting Ice.UseOSLog to 1.
.NET Logger
The default logger in Ice for C# writes its messages with the System.Diagnostics.Trace class. By default, Ice adds its own console listener, which writes to stderr. You can disable the logging of messages via this trace listener by setting the property Ice.ConsoleListener to 0.
You can add your own trace listener programmatically. For example:
// Create a trace listener for the event log.EventLogTraceListener myTraceListener = new EventLogTraceListener("myEventLogSource");
// Add the event log trace listener to the collection.Trace.Listeners.Add(myTraceListener);Syslog Logger
On platforms other than Windows, you can activate a logger that logs via the Unix syslog implementation by setting Ice.UseSyslog to 1. This logger sends its messages over UDP to the syslog daemon at Ice.SyslogHost and Ice.SyslogPort.
Syslog Logger
On Linux, you can activate a logger that logs via the Unix syslog implementation by setting Ice.UseSyslog to 1.
Systemd Journal Logger
On Linux, you can activate a logger that logs to the systemd journal by setting Ice.UseSystemdJournal to 1. This logger is available only when Ice is built with systemd support.
Syslog Logger
On Linux and macOS, you can activate a logger that logs via the Unix syslog implementation by setting Ice.UseSyslog to 1.
Systemd Journal Logger
On Linux, you can activate a logger that logs to the systemd journal by setting Ice.UseSystemdJournal to 1. This logger is available only when Ice is built with systemd support.
OSLog Logger
On macOS, you can activate a logger that logs using OSLog by setting Ice.UseOSLog to 1.
Syslog Logger
On macOS, you can activate a logger that logs via the Unix syslog implementation by setting Ice.UseSyslog to 1.
OSLog Logger
On macOS and iOS, you can activate a logger that logs using OSLog by setting Ice.UseOSLog to 1.