# Adjust temporal logging level

**URL:** <https://community.temporal.io/t/adjust-temporal-logging-level/6828>\
**Category:** Community Support\
**Tags:** docker\
**Created:** [January 3, 2023, 2:44pm UTC](https://community.temporal.io/t/adjust-temporal-logging-level/6828 "2023-01-03T14:44:28Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![dsc](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/dsc/32/3139_2.png) [@dsc](https://community.temporal.io/u/dsc)\
**Post date:** [January 3, 2023, 2:44pm UTC](https://community.temporal.io/t/adjust-temporal-logging-level/6828/1 "2023-01-03T14:44:29Z")

</div>

Is it possible to adjust the level of log output for temporal? When I run temporal within a docker container it’s defaulting to outputting `info` level logs and I prefer to have logs only output more severe levels such as `warn` and `error`.

At the moment, the docker logs are flooded with temporal log entires such as this:

```auto
temporal | {"level":"info","ts":"2023-01-03T14:35:13.281Z","msg":"Get dynamic config","name":"system.clusterMetadataRefreshInterval","value":60,"default-value":60,"logging-call-at":"config.go:79"}
temporal | {"level":"info","ts":"2023-01-03T14:35:13.298Z","msg":"Membership heartbeat upserted successfully","service":"history","address":"172.18.0.3","port":6934,"hostId":"cc063654-8b73-11ed-99d7-0242ac120003","logging-call-at":"rpMonitor.go:222"}
temporal | {"level":"info","ts":"2023-01-03T14:35:13.303Z","msg":"bootstrap hosts fetched","service":"history","bootstrap-hostports":"172.18.0.3:6935,172.18.0.3:6934","logging-call-at":"rpMonitor.go:263"}
temporal | {"level":"info","ts":"2023-01-03T14:35:13.312Z","msg":"Current reachable members","service":"history","component":"service-resolver","service":"history","addresses":["172.18.0.3:7234"],"logging-call-at":"rpServiceResolver.go:266"}
temporal | {"level":"info","ts":"2023-01-03T14:35:13.317Z","msg":"RuntimeMetricsReporter started","service":"history","logging-call-at":"runtime.go:139"}
temporal | {"level":"info","ts":"2023-01-03T14:35:13.320Z","msg":"history starting","service":"history","logging-call-at":"service.go:96"}
temporal | {"level":"info","ts":"2023-01-03T14:35:13.320Z","msg":"Replication task fetchers started.","logging-call-at":"replicationTaskFetcher.go:141"}
temporal | {"level":"info","ts":"2023-01-03T14:35:13.321Z","msg":"Get dynamic config","name":"history.acquireShardConcurrency","value":10,"default-value":10,"logging-call-at":"config.go:79"}
temporal | {"level":"info","ts":"2023-01-03T14:35:13.322Z","msg":"Get dynamic config","name":"history.eventsCacheInitialSize","value":128,"default-value":128,"logging-call-at":"config.go:79"}
temporal | {"level":"info","ts":"2023-01-03T14:35:13.323Z","msg":"Get dynamic config","name":"history.eventsCacheMaxSize","value":512,"default-value":512,"logging-call-at":"config.go:79"}
temporal | {"level":"info","ts":"2023-01-03T14:35:13.324Z","msg":"Get dynamic config","name":"history.eventsCacheTTL","value":3600,"default-value":3600,"logging-call-at":"config.go:79"}

```

Which makes it harder to spot more severe (`error`) log entries.

---

<div class="post-metadata">

**Author:** ![antonio.perez](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/antonio.perez/32/2417_2.png) [@antonio.perez](https://community.temporal.io/u/antonio.perez)\
**Post date:** [January 3, 2023, 3:21pm UTC](https://community.temporal.io/t/adjust-temporal-logging-level/6828/2 "2023-01-03T15:21:56Z")

</div>

Hello @dsc

can you try setting the env variable `LOG_LEVEL`?

> <https://github.com/temporalio/temporal/blob/4d56df95e35dbba798fcf9eb715012e8cec8a111/docker/config_template.yaml#L3>

Let me know if it works.

Regards,  
Antonio

---

<div class="post-metadata">

**Author:** ![dsc](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/dsc/32/3139_2.png) [@dsc](https://community.temporal.io/u/dsc)\
**Post date:** [January 3, 2023, 5:20pm UTC](https://community.temporal.io/t/adjust-temporal-logging-level/6828/3 "2023-01-03T17:20:48Z")

</div>

That did it @antonio.perez, thank you very much.

---

<div class="post-metadata">

**Author:** ![jasondiazg](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/jasondiazg/32/5647_2.png) [@jasondiazg](https://community.temporal.io/u/jasondiazg)\
**Post date:** [July 31, 2024, 11:25pm UTC](https://community.temporal.io/t/adjust-temporal-logging-level/6828/4 "2024-07-31T23:25:40Z")

</div>

Hi, just in case someone else is interested:

I am working with the TypeScript SDK, I tried setting `LOG_LEVEL` like @antonio.perez sugested, however it didn’t work, so what I did is to define my own definition the DefaultLogger and pass my logger level in the worker definition like this:

```auto
import { DefaultLogger, makeTelemetryFilterString, Runtime } from '@temporalio/worker';

...
const loggerLevel = "DEBUG"; // you can get this value from wherever you want
const coreLoggerLevel = "INFO"; // you can also get this value from wherever you want, notice that it is only for the temporal core and other layers
const logger = new DefaultLogger(loggerLevel);
Runtime.install({
  logger,
  telemetryOptions: {
    logging: {
      filter: makeTelemetryFilterString({ core: coreLoggerLevel, other: coreLoggerLevel })
    },
  },
}); 
...

```

It worked like a charm. More info of this: [Observability | Temporal Documentation](https://docs.temporal.io/develop/typescript/observability#implementing-custom-logging-like-features-based-on-workflow-sinks)

---

<div class="post-metadata">

**Author:** ![antonio.perez](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/antonio.perez/32/2417_2.png) [@antonio.perez](https://community.temporal.io/u/antonio.perez)\
**Post date:** [August 1, 2024, 12:06pm UTC](https://community.temporal.io/t/adjust-temporal-logging-level/6828/5 "2024-08-01T12:06:36Z")

</div>

Thanks @jasondiazg

> More info of this: [Observability | Temporal Documentation](https://docs.temporal.io/develop/typescript/observability?&_ga=2.215483479.1908742347.1722159711-227407496.1714657739#implementing-custom-logging-like-features-based-on-workflow-sinks)

yes, this is how you can configure the logs on the worker side.

Antonio

---

<div class="post-metadata">

**Author:** ![MichaelKruglov](https://avatars.discourse-cdn.com/v4/letter/m/6f9a4e/32.png) [@MichaelKruglov](https://community.temporal.io/u/MichaelKruglov)\
**Post date:** [August 9, 2024, 10:16am UTC](https://community.temporal.io/t/adjust-temporal-logging-level/6828/6 "2024-08-09T10:16:59Z")

</div>

Hi @antonio.perez  
On my worker side I can see unstoppable debug logs like in this thread: [Resetting gRPC connection backoff](https://community.temporal.io/t/resetting-grpc-connection-backoff/996)

As I understand from reply this is normal behavior, so I wonder how can I hide these logs and adjust default log level for temporal workers with JAVA SDK.  
Unfortunately can’t find it there:

> **[Observability | Temporal Documentation](https://docs.temporal.io/develop/java/observability#logging)**
>
> Explore the observability features of Temporal, including Metrics, Tracing, Logging, and Visibility. Learn to emit Metrics with the Java SDK, set up Tracing, and use Search Attributes.

---

<div class="post-metadata">

**Author:** ![antonio.perez](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/antonio.perez/32/2417_2.png) [@antonio.perez](https://community.temporal.io/u/antonio.perez)\
**Post date:** [August 9, 2024, 10:47am UTC](https://community.temporal.io/t/adjust-temporal-logging-level/6828/7 "2024-08-09T10:47:12Z")

</div>

Hi @MichaelKruglov

For Java I believe it depends on the logger implementation, for logback (and others like log4j) you can set the configuration at the package level, there is an example in our [samples repo](https://github.com/temporalio/samples-java/blob/bcdc8db8f122de9c10b277c6248eabd473032fe7/core/src/main/resources/logback.xml#L30)

Antonio
