# Dotnet 6.0 log level setting

**URL:** <https://discuss.elastic.co/t/dotnet-6-0-log-level-setting/315258>\
**Category:** APM\
**Tags:** dotnet\
**Created:** [September 27, 2022, 12:53pm UTC](https://discuss.elastic.co/t/dotnet-6-0-log-level-setting/315258 "2022-09-27T12:53:15Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Simonjanzon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/simonjanzon/32/111340_2.png) [@Simonjanzon](https://discuss.elastic.co/u/Simonjanzon)\
**Post date:** [September 27, 2022, 12:53pm UTC](https://discuss.elastic.co/t/dotnet-6-0-log-level-setting/315258/1 "2022-09-27T12:53:15Z")

</div>

**APM Agent language and version** : dotnet, Elastic.Apm.NetCoreAll version 1.17.0

**Browser version** : N/A

**Original install method (e.g. download page, yum, deb, from source, etc.) and version**: N/A

**Fresh install or upgraded from other version?** N/A

**Is there anything special in your setup?** For example, are you using the Logstash or Kafka outputs? Are you using a load balancer in front of the APM Servers? Have you changed index pattern, generated custom templates, changed agent configuration etc. N/A

**Description of the problem including expected versus actual behavior. Please include screenshots (if relevant)**:

We are seeing many (around 10 per minute) log entries like this one for all the services which we enabled apm for and it is clogging our logs.  
`[12:45:53 INF] {Transaction} Dropping unsampled transaction - unsampled transactions won't be sent on APM Server v8+. TransactionId: 0f1c2e883beec7dc`

First of all, why is it logged? What does it mean?

I tried changing the log level of the agent according to [Supportability configuration options | APM .NET Agent Reference [1.12] | Elastic](https://www.elastic.co/guide/en/apm/agent/dotnet/current/config-supportability.html#config-log-level), tried out all 3 different ways and none of them worked. The logs are still there.

FYI, we are using serilog for our logs.

**Steps to reproduce** :

1. Setup agent and use UseAllElasticApm() method.
2. Try changing log level behaviour to get rid of unnecessary logs by modifying app settings and/or environment variables.
3. See that the logs still persist.

**Errors in browser console (if relevant)**: N/A

**Provide logs and/or server output (if relevant)**: N/A

---

<div class="post-metadata">

**Author:** ![Wolfgang\_Ziegler](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wolfgang_ziegler/32/109929_2.png) [@Wolfgang\_Ziegler](https://discuss.elastic.co/u/Wolfgang_Ziegler)\
**Post date:** [September 27, 2022, 1:35pm UTC](https://discuss.elastic.co/t/dotnet-6-0-log-level-setting/315258/2 "2022-09-27T13:35:53Z")

</div>

Hi @Simonjanzon,

To answer your first question:

> First of all, why is it logged? What does it mean?

This message is an indication that you have a [TransactionSampleRate](https://www.elastic.co/guide/en/apm/agent/dotnet/current/config-core.html#config-transaction-sample-rate) configured for your monitored service.

In case a transaction is **not** sampled (i.e. it is not reported to APM server), a log message with severity `Info` is reported. That's what you are encountering.

Can you please check which [LogLevel](https://www.elastic.co/guide/en/apm/agent/dotnet/current/config-supportability.html#config-log-level) you are using in your service?

Also, which way of configuration are you using (environment variables, config file, ...)?

Thanks,  
Wolgang

---

<div class="post-metadata">

**Author:** ![Simonjanzon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/simonjanzon/32/111340_2.png) [@Simonjanzon](https://discuss.elastic.co/u/Simonjanzon)\
**Post date:** [September 27, 2022, 3:46pm UTC](https://discuss.elastic.co/t/dotnet-6-0-log-level-setting/315258/3 "2022-09-27T15:46:55Z")

</div>

Hi @Wolfgang_Ziegler

Thanks for your reply.

We have tried setting the LogLevel in three different ways

1. Environment variable: ELASTIC\_APM\_LOG\_LEVEL, value: **None**
2. appsettings.json using Logging setting

```auto
"Logging": {
    "LogLevel": { 
      "Default": "Warning",
      "Elastic.Apm": "None"
    }
  },

```

1. appsettings using ElasticApm setting

```auto
"ElasticApm":
    {
      "LogLevel": "None"
}

```

None of these alternatives removed the unsampled transaction log. Could it be overwritten somehow?

Best,  
Simon

---

<div class="post-metadata">

**Author:** ![Wolfgang\_Ziegler](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wolfgang_ziegler/32/109929_2.png) [@Wolfgang\_Ziegler](https://discuss.elastic.co/u/Wolfgang_Ziegler)\
**Post date:** [September 27, 2022, 5:20pm UTC](https://discuss.elastic.co/t/dotnet-6-0-log-level-setting/315258/4 "2022-09-27T17:20:11Z")

</div>

Hi @Simonjanzon,

since the `LogLevel` is a _dynamic_ setting it can also be changed via **Central Configuration** (see [here](https://www.elastic.co/guide/en/kibana/8.4/agent-configuration.html)).

Hope this helps,  
Wolfgang

---

<div class="post-metadata">

**Author:** ![Simonjanzon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/simonjanzon/32/111340_2.png) [@Simonjanzon](https://discuss.elastic.co/u/Simonjanzon)\
**Post date:** [September 28, 2022, 6:10am UTC](https://discuss.elastic.co/t/dotnet-6-0-log-level-setting/315258/5 "2022-09-28T06:10:22Z")

</div>

Hi,

Thanks. I'll check that out and get back.

Best regards,  
Simon

---

<div class="post-metadata">

**Author:** ![Simonjanzon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/simonjanzon/32/111340_2.png) [@Simonjanzon](https://discuss.elastic.co/u/Simonjanzon)\
**Post date:** [October 11, 2022, 7:31am UTC](https://discuss.elastic.co/t/dotnet-6-0-log-level-setting/315258/6 "2022-10-11T07:31:59Z")

</div>

Hi again,

We tried the central configuration as well, but without luck.

These dropped transactions logs are really clogging the readability in our log system. Any chance you could replicate it?

---

<div class="post-metadata">

**Author:** ![GregKalapos](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gregkalapos/32/37205_2.png) [@GregKalapos](https://discuss.elastic.co/u/GregKalapos)\
**Post date:** [October 11, 2022, 9:44am UTC](https://discuss.elastic.co/t/dotnet-6-0-log-level-setting/315258/7 "2022-10-11T09:44:47Z")

</div>

Hi @Simonjanzon

one thing which happened in the meantime is that there was a change in the agent and these logs will be printed on debug level (instead of info) from the next agent version: [Use debug log level when dropping spans by z1c0 · Pull Request #1850 · elastic/apm-agent-dotnet · GitHub](https://github.com/elastic/apm-agent-dotnet/pull/1850)

---

<div class="post-metadata">

**Author:** ![Simonjanzon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/simonjanzon/32/111340_2.png) [@Simonjanzon](https://discuss.elastic.co/u/Simonjanzon)\
**Post date:** [October 12, 2022, 11:41am UTC](https://discuss.elastic.co/t/dotnet-6-0-log-level-setting/315258/8 "2022-10-12T11:41:29Z")

</div>

Hi Greg,

That sounds like a good solution. Do you have any idea of when it will be released? 🙂

---

<div class="post-metadata">

**Author:** ![GregKalapos](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gregkalapos/32/37205_2.png) [@GregKalapos](https://discuss.elastic.co/u/GregKalapos)\
**Post date:** [October 13, 2022, 10:42pm UTC](https://discuss.elastic.co/t/dotnet-6-0-log-level-setting/315258/9 "2022-10-13T22:42:38Z")

</div>

Hi @Simonjanzon,

we just pushed out a new release: [Release v1.18.0 · elastic/apm-agent-dotnet · GitHub](https://github.com/elastic/apm-agent-dotnet/releases/tag/v1.18.0) NuGet packages are getting indexed as well.

The change mentioned above is included in this release.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [November 3, 2022, 6:43pm UTC](https://discuss.elastic.co/t/dotnet-6-0-log-level-setting/315258/10 "2022-11-03T18:43:11Z")

</div>

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.
