---
title: "The Per-Process Logger"
url: https://docs.zeroc.com/ice/3.8/administration/logger-facility/per-process-logger
language: js
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

Programming language: JavaScript. Other languages: [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), [Python](https://docs.zeroc.com/ice/3.8/administration/logger-facility/per-process-logger/python.md), [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.

Ice allows you to install a [custom logger](https://docs.zeroc.com/ice/3.8/administration/logger-facility/custom-loggers/js.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`:

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

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`.)
