> 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="https://4057366433-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAjqTCMRYvHhDgsdPLUnc%2Fuploads%2FInV0c4SALtbizNMwAOPA%2Fimage-20210303-075757.png?alt=media&amp;token=ff134a6b-c8c3-44b2-a201-ac8e6247f420" 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
