---
title: "The Per-Process Logger"
url: https://docs.zeroc.com/ice/3.8/administration/logger-facility/per-process-logger
docs_index: https://docs.zeroc.com/llms.txt
---

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

# The Per-Process Logger

This page is written for C++, C#, Java, JavaScript, Python, and Ruby.

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/per-process-logger/cpp.md), [C#](https://docs.zeroc.com/ice/3.8/administration/logger-facility/per-process-logger/csharp.md), [Java](https://docs.zeroc.com/ice/3.8/administration/logger-facility/per-process-logger/java.md), [JavaScript](https://docs.zeroc.com/ice/3.8/administration/logger-facility/per-process-logger/js.md), [Python](https://docs.zeroc.com/ice/3.8/administration/logger-facility/per-process-logger/python.md), and [Ruby](https://docs.zeroc.com/ice/3.8/administration/logger-facility/per-process-logger/ruby.md).

A communicator created without a logger of its own and without logger properties uses the per-process logger if you set one with `setProcessLogger`, and Ice's default logger otherwise.

> **C++, C#, Java, JavaScript, and Python**
>
> Ice allows you to install a [custom logger](https://docs.zeroc.com/ice/3.8/administration/logger-facility/custom-loggers.md) as the per-process logger. You can set a per-process logger by calling `setProcessLogger`, and you can retrieve the per-process logger by calling `getProcessLogger`:

> **C++**
>
> ```cpp
> namespace Ice
> {
>     LoggerPtr getProcessLogger();
>     void setProcessLogger(const LoggerPtr&);
> }
> ```

> **C#**
>
> ```csharp
> namespace Ice;
>
> public sealed class Util
> {
>     public static Logger getProcessLogger()
>     {
>       ...
>     }
>
>     public static void setProcessLogger(Logger logger)
>     {
>       ...
>     }
> }
> ```

> **Java**
>
> ```java
> package com.zeroc.Ice;
>
> public final class Util
> {
>     public static Logger getProcessLogger()
>     {
>       ...
>     }
>
>     public static void setProcessLogger(Logger logger)
>     {
>       ...
>     }
> }
> ```

> **JavaScript**
>
> ```typescript
> declare module "@zeroc/ice" {
>     namespace Ice {
>         function getProcessLogger(): Ice.Logger;
>         function setProcessLogger(logger: Ice.Logger): void;
>     }
> }
> ```

> **Python**
>
> ```py
> def getProcessLogger() -> Ice.Logger:
>   ...
> def setProcessLogger(logger: Ice.Logger) -> None:
>   ...
> ```

> **Ruby**
>
> You can retrieve the per-process logger by calling `Ice::getProcessLogger`. Ice for Ruby provides no API to install a per-process logger.

> **C++, C#, Java, JavaScript, and Python**
>
> If you call `getProcessLogger` without having called `setProcessLogger` first, the Ice runtime installs a default per-process logger. Note that if you call `setProcessLogger`, only communicators created after that point without a logger of their own will use this per-process logger; communicators created earlier use the logger that was in effect at the time they were created. (This also means that you can call `setProcessLogger` multiple times; communicators created after that point will use whatever logger was established by the last call to `setProcessLogger`.)
