> For the complete documentation index, see [llms.txt](https://docs.sealights.io/knowledgebase/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sealights.io/knowledgebase/setup-and-configuration/troubleshooting-faq/.net-.netcore/collecting-profiler-logs.md).

# Collecting Profiler Logs

When debugging issues related to coverage on .NET, we sometimes need to retrieve Profiler logs.

The Profiler is a C++ component in charge of instrumenting tests during runtime, as well as the applications under test.

The following document details the necessary steps to collect these logs.

***

### Collecting Profiler logs from IIS <a href="#collecting-profiler-logs-from-iis" id="collecting-profiler-logs-from-iis"></a>

1. Open the Registry editor (regedit.exe)
2. Navigate to your service’s key: `System\CurrentControlSet\Services\WAS`
3. In the “Environment” multi-string value, add the following parameters in separate lines:
   1. `SL_LogLevel=6`
   2. `SL_LogDir=C:\SeaLights\Logs`
4. Perform the previous step on `System\CurrentControlSet\Services\W3SVC`
5. Restart IIS `iisreset /restart`

### Collecting Profiler logs from Windows Services <a href="#collecting-profiler-logs-from-windows-services" id="collecting-profiler-logs-from-windows-services"></a>

1. Open the Registry editor (regedit.exe)
2. Navigate to your service’s key: `System\CurrentControlSet\Services{YourService}`
3. In the “Environment” multi-string value, add the following parameters in separate lines:
   1. `SL_LogLevel=6`
   2. `SL_LogDir=C:\SeaLights\Logs`

### Collecting Profiler logs from Windows Processes <a href="#collecting-profiler-logs-from-windows-processes" id="collecting-profiler-logs-from-windows-processes"></a>

1. Define the following Environment Variables in the environment from which your process is started:
   1. `SL_LogLevel=6`
   2. `SL_LogDir=C:\SeaLights\Logs`
2. This can be achieved by running the following commands in their respective shells:
   1. `set SL_LogLevel=6`
   2. `set SL_LogDir=C:\SeaLights\Logs`

{% hint style="info" %}
Note: if your process starts from within a .bat file, a PowerShell script etc, the above environment variables need to be declared in those shells, or as Global environment variables.
{% endhint %}

### Collecting Profiler logs from VSTS/Azure DevOps Test Stages <a href="#collecting-profiler-logs-from-vsts-azure-devops-test-stages" id="collecting-profiler-logs-from-vsts-azure-devops-test-stages"></a>

1. In the “SeaLights Start Test Execution” step:
   1. Set the “Profiler log level” to Debug

      <figure><img src="/files/RfSfixiIA7lFxwCiByev" alt=""><figcaption></figcaption></figure>
2. Run the build, including the test stage in question
3. After the build finished, review the logging destination:
   1. Select the “SeaLights Start Test Execution” log
   2. Towards the end of the logging output, there should be a string “Logs will be saved to”
   3. The logging files will be inside the folder denoted above


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.sealights.io/knowledgebase/setup-and-configuration/troubleshooting-faq/.net-.netcore/collecting-profiler-logs.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
