# Set data collection and crash reporting levels

**URL:** <https://community.dynatrace.com/t/set-data-collection-and-crash-reporting-levels/44827>\
**Category:** Open Q&A\
**Tags:** openkit\
**Created:** [March 24, 2024, 3:27pm UTC](https://community.dynatrace.com/t/set-data-collection-and-crash-reporting-levels/44827 "2024-03-24T15:27:17Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![swapnil](https://avatars.discourse-cdn.com/v4/letter/s/ee7513/32.png) [@swapnil](https://community.dynatrace.com/u/swapnil)\
**Post date:** [March 24, 2024, 3:27pm UTC](https://community.dynatrace.com/t/set-data-collection-and-crash-reporting-levels/44827/1 "2024-03-24T15:27:17Z")

</div>

When i add this properties into my OpenKitBuilder i start getting following errors  
&nbsp; &nbsp; &nbsp; &nbsp; .withLogLevel(LogLevel.Error)&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;// set a data collection level (user allowed you to capture performance and personal data)&nbsp; &nbsp; &nbsp; &nbsp; .withDataCollectionLevel(DataCollectionLevel.UserBehavior)&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;// allow crash reporting (user allowed you to collect information on crashes)&nbsp; &nbsp; &nbsp; &nbsp; .withCrashReportingLevel(CrashReportingLevel.OptInCrashes)dtOpenKit.ts:50 TypeError: Cannot read properties of undefined (reading ‘Error’)  
[dtOpenKit.txt](https://community.dynatrace.com/uploads/short-url/53mzVONNZzISbDj3lnswEoHjFKK.txt) (7.56 KB)

---

<div class="post-metadata">

**Author:** ![swapnil](https://avatars.discourse-cdn.com/v4/letter/s/ee7513/32.png) [@swapnil](https://community.dynatrace.com/u/swapnil)\
**Post date:** [April 22, 2024, 10:32am UTC](https://community.dynatrace.com/t/set-data-collection-and-crash-reporting-levels/44827/2 "2024-04-22T10:32:35Z")

</div>

any help?

---

<div class="post-metadata">

**Author:** ![PierreGutierrez](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/pierregutierrez/32/5934_2.png) [@PierreGutierrez](https://community.dynatrace.com/u/PierreGutierrez)\
**Post date:** [April 28, 2024, 3:48am UTC](https://community.dynatrace.com/t/set-data-collection-and-crash-reporting-levels/44827/3 "2024-04-28T03:48:54Z")

</div>

Hi&nbsp;[@swapnil](https://community.dynatrace.com/user/60738)

Of the 3 configurations that you are applying. 2 are default configurations (it means that you do not need to apply the configuration at the code level).

We suggest you first carry out tests with the 3 default values. and then just add “.withLogLevel(LogLevel.Error)” and validate again.

 ![PierreGutierrez_0-1714275983269.png](https://global.discourse-cdn.com/dynatrace/original/2X/1/1788447a6e42dc613a64be6f77cd8de71004e243.png)

> **[Dynatrace OpenKit API methods](https://docs.dynatrace.com/docs/ingest-from/extend-dynatrace/openkit/dynatrace-openkit-api-methods)**
>
> Read how Dynatrace OpenKit can be used from the developer's point of view.

Tell us how it goes.

I hope it’s helpful 💪

---

<div class="post-metadata">

**Author:** ![swapnil](https://avatars.discourse-cdn.com/v4/letter/s/ee7513/32.png) [@swapnil](https://community.dynatrace.com/u/swapnil)\
**Post date:** [April 28, 2024, 10:58pm UTC](https://community.dynatrace.com/t/set-data-collection-and-crash-reporting-levels/44827/4 "2024-04-28T22:58:02Z")

</div>

I don’t have dynatrace agent running on my host. will this default setting still be working.

As soon as add

.withLogLevel(LogLevel.Info)It starts throwing an error&nbsp;

 ![swapnil_0-1714345064217.png](https://global.discourse-cdn.com/dynatrace/original/3X/9/3/9392ede28e071f584c673f5544e32ca557793696.png)

---

<div class="post-metadata">

**Author:** ![PierreGutierrez](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/pierregutierrez/32/5934_2.png) [@PierreGutierrez](https://community.dynatrace.com/u/PierreGutierrez)\
**Post date:** [April 29, 2024, 1:58am UTC](https://community.dynatrace.com/t/set-data-collection-and-crash-reporting-levels/44827/5 "2024-04-29T01:58:36Z")

</div>

Hi&nbsp;[@swapnil](https://community.dynatrace.com/user/60738)&nbsp;  
Dynatrace OpenKit offers a number of API methods that enable you to integrate OpenKit into your application.

With Dynatrace OpenKit you are not using a dynatrace agent, you are using a Dynatrace openkit Library, and all instrumentation its manual.

**As I recommended, I suggest you carry out your tests with OpenKit, without modifying the 3 default values (without placing LogLevel.Info).**

For clients that implement instrumentation for mobile applications, you only need to configure LogLevel.Debug or another, when there is an issue where “the expected data does not seem to be sent.”

However, it is not required to change this default value in other cases.
