---
title: "Built-in Loggers"
url: https://docs.zeroc.com/ice/3.8/administration/logger-facility/built-in-loggers
docs_index: https://docs.zeroc.com/llms.txt
---

> For an index of every page, see [llms.txt](https://docs.zeroc.com/llms.txt).

# Built-in Loggers

Parts of this page are for some programming languages only, and name them. For one language's text alone, see [C++](https://docs.zeroc.com/ice/3.8/administration/logger-facility/built-in-loggers/cpp.md), [C#](https://docs.zeroc.com/ice/3.8/administration/logger-facility/built-in-loggers/csharp.md), [Java](https://docs.zeroc.com/ice/3.8/administration/logger-facility/built-in-loggers/java.md), [JavaScript](https://docs.zeroc.com/ice/3.8/administration/logger-facility/built-in-loggers/js.md), [MATLAB](https://docs.zeroc.com/ice/3.8/administration/logger-facility/built-in-loggers/matlab.md), [PHP](https://docs.zeroc.com/ice/3.8/administration/logger-facility/built-in-loggers/php.md), [Python](https://docs.zeroc.com/ice/3.8/administration/logger-facility/built-in-loggers/python.md), [Ruby](https://docs.zeroc.com/ice/3.8/administration/logger-facility/built-in-loggers/ruby.md), and [Swift](https://docs.zeroc.com/ice/3.8/administration/logger-facility/built-in-loggers/swift.md).

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](https://docs.zeroc.com/ice/3.8/property-reference/ice-properties.md#ice.logfile) property selects the file-based logger (JavaScript: in Node.js). This logger appends its messages to the specified file and creates the file if necessary.

> **C++, Python, Ruby, PHP, MATLAB, and Swift**
>
> [Ice.LogFile.SizeMax](https://docs.zeroc.com/ice/3.8/property-reference/ice-properties.md#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.

> **C++**
>
> ## Syslog Logger
>
> On Linux and macOS, you can activate a logger that logs via the Unix `syslog` implementation by setting [Ice.UseSyslog](https://docs.zeroc.com/ice/3.8/property-reference/ice-properties/cpp.md#ice.usesyslog) to `1`.
>
> ## Systemd Journal Logger
>
> On Linux, you can activate a logger that logs to the systemd journal by setting [Ice.UseSystemdJournal](https://docs.zeroc.com/ice/3.8/property-reference/ice-properties/cpp.md#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](https://developer.apple.com/documentation/os/oslog) by setting [Ice.UseOSLog](https://docs.zeroc.com/ice/3.8/property-reference/ice-properties/cpp.md#ice.useoslog) to `1`.

> **C#**
>
> ## .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](https://docs.zeroc.com/ice/3.8/property-reference/ice-properties/csharp.md#ice.consolelistener) to `0`.
>
> You can add your own trace listener programmatically. For example:
>
> ```csharp
> // 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);
> ```

> **Java**
>
> ## Syslog Logger
>
> On platforms other than Windows, you can activate a logger that logs via the Unix `syslog` implementation by setting [Ice.UseSyslog](https://docs.zeroc.com/ice/3.8/property-reference/ice-properties/java.md#ice.usesyslog) to `1`. This logger sends its messages over UDP to the syslog daemon at [Ice.SyslogHost](https://docs.zeroc.com/ice/3.8/property-reference/ice-properties/java.md#ice.sysloghost) and [Ice.SyslogPort](https://docs.zeroc.com/ice/3.8/property-reference/ice-properties/java.md#ice.syslogport).

> **MATLAB**
>
> ## Syslog Logger
>
> On Linux, you can activate a logger that logs via the Unix `syslog` implementation by setting [Ice.UseSyslog](https://docs.zeroc.com/ice/3.8/property-reference/ice-properties/matlab.md#ice.usesyslog) to `1`.
>
> ## Systemd Journal Logger
>
> On Linux, you can activate a logger that logs to the systemd journal by setting [Ice.UseSystemdJournal](https://docs.zeroc.com/ice/3.8/property-reference/ice-properties/matlab.md#ice.usesystemdjournal) to `1`. This logger is available only when Ice is built with systemd support.

> **PHP, Python, and Ruby**
>
> ## Syslog Logger
>
> On Linux and macOS, you can activate a logger that logs via the Unix `syslog` implementation by setting [Ice.UseSyslog](https://docs.zeroc.com/ice/3.8/property-reference/ice-properties.md#ice.usesyslog) to `1`.
>
> ## Systemd Journal Logger
>
> On Linux, you can activate a logger that logs to the systemd journal by setting [Ice.UseSystemdJournal](https://docs.zeroc.com/ice/3.8/property-reference/ice-properties.md#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](https://developer.apple.com/documentation/os/oslog) by setting [Ice.UseOSLog](https://docs.zeroc.com/ice/3.8/property-reference/ice-properties.md#ice.useoslog) to `1`.

> **Swift**
>
> ## Syslog Logger
>
> On macOS, you can activate a logger that logs via the Unix `syslog` implementation by setting [Ice.UseSyslog](https://docs.zeroc.com/ice/3.8/property-reference/ice-properties/swift.md#ice.usesyslog) to `1`.
>
> ## OSLog Logger
>
> On macOS and iOS, you can activate a logger that logs using [OSLog](https://developer.apple.com/documentation/os/oslog) by setting [Ice.UseOSLog](https://docs.zeroc.com/ice/3.8/property-reference/ice-properties/swift.md#ice.useoslog) to `1`.

## See Also

- [Service Logging Considerations](https://docs.zeroc.com/ice/3.8/background-servers/service-logging-considerations.md)
