Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions content/en/docs/2025.3/FAQs/change-logging-levels/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
title: "How do I change the Logging Level?"
linkTitle: "How do I change the Logging Level?"
description: "Instructions on how to change the {{% ctx %}} Logging Level."
weight: 1000
---

{{% ctx %}} Logging Levels are set to `Error` by default for most services. However, levels can be changed whilst {{% ctx %}} is running by sending REST calls to the {{% ctx %}} API Gateway service.

{{% alert title="Note" %}}
Although the Logging Level for the {{% ctx %}} API Gateway service can be increased, it will still always log all API calls regardless of Logging Level configured.
{{% / alert %}}

If increasing the Logging Level, particularly if increasing for everything or for Block Logging, we recommend that this is done only when required. Increasing log levels will lead to an increase in disk usage and disk writes, which can impact the performance of the {{% ctx %}} platform if not monitored.

Whilst increased Logging Levels are in place, we would recommend closely monitoring system performance and disk space usage.

All REST calls to update Logging Levels use Basic Auth and can be made using REST clients such as [Postman][] or using scripts such as PowerShell.

[Postman]: {{< url path="Postman.Downloads.MainDoc" >}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
---
title: "Change All Logging Levels"
linkTitle: "Change All Logging Levels"
description: "Instructions on how to change the Logging Level for All Logging."
weight: 10
---

# {{% param title %}}

To change the Logging Level for all services, the below PowerShell script can be used to make a REST call against your {{% ctx %}} platform.

1. Run Windows PowerShell ISE as Administrator.
1. Copy the following script into the PowerShell window:

``` powershell
$serverFQDN = "server.domain.com"
$APIGatewayPort = 8722
$loglevel = 4
$user = "BasicAuthUser"

$securePass = Read-Host -Prompt "Enter password for $user" -AsSecureString

$ptr = [Runtime.InteropServices.Marshal]::SecureStringToBSTR($securePass)
try {
$plainPass = [Runtime.InteropServices.Marshal]::PtrToStringBSTR($ptr)

$authBytes = [System.Text.Encoding]::ASCII.GetBytes("$user`:$plainPass")
$base64AuthInfo = [Convert]::ToBase64String($authBytes)
}
finally {
[Runtime.InteropServices.Marshal]::ZeroFreeBSTR($ptr)

$plainPass = $null
Remove-Variable -Name plainPass -Force
}

$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
$headers.Add("Content-Type", "application/json")
$headers.Add("Accept", "application/json")
$headers.Add("Authorization", "Basic $base64AuthInfo")
$path = "applications/logging"
$body = @"
$loglevel
"@

$response = Invoke-RestMethod "https://${serverFQDN}:$APIGatewayPort/api/v1/default/default/$path" -Method PUT -Headers $headers -Body $body
$response
```

1. Configure the following variables:
* `$serverFQDN` – The fully qualified domain name for the Application Server or Load Balancer
* `$APIGatewayPort` – {{% ctx %}} API Gateway Service Port (8722) or Load Balancer port (typically 443 or 8722)
* `$loglevel` – Desired log level as an integer, `1` is enabled and `4` is the default error level
* `$user` – {{% ctx %}} API Gateway Basic Auth Username

1. Execute the script, entering the Basic Auth User's password when prompted.
1. Confirm success response:

If the call was successful, there should be no errors and the following response should be received

``` powershell
LogLevel was successfully configured.
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
---
title: "Change Block Logging Level"
linkTitle: "Change Block Logging Level"
description: "Instructions on how to change the Logging Level for Block Logging."
weight: 5
---

# {{% param title %}}

Block Logging in {{% ctx %}} logs the following Block Properties by default regardless of the log level configured:

* Execute Data Command
* Command > commandText
* Command > parameters
* Execute Http Request
* Http Request
* Http Response
* Execute Soap Request
* Soap Request
* Soap Response
* Execute PowerShell Script
* Script
* Parameters
* Outputs
* Records
* Execute Ssh Command
* Command
* Response
* Ssh Logs

To change the Logging Level for Block Logging so that every block is logged when executed, the below PowerShell script can be used to make a REST call against your {{% ctx %}} platform.

1. Run Windows PowerShell ISE as Administrator.
1. Copy the following script into the PowerShell window:

``` powershell
$serverFQDN = "server.domain.com"
$APIGatewayPort = 8722
$loglevel = 4
$user = "BasicAuthUser"

$securePass = Read-Host -Prompt "Enter password for $user" -AsSecureString

$ptr = [Runtime.InteropServices.Marshal]::SecureStringToBSTR($securePass)
try {
$plainPass = [Runtime.InteropServices.Marshal]::PtrToStringBSTR($ptr)

$authBytes = [System.Text.Encoding]::ASCII.GetBytes("$user`:$plainPass")
$base64AuthInfo = [Convert]::ToBase64String($authBytes)
}
finally {
[Runtime.InteropServices.Marshal]::ZeroFreeBSTR($ptr)

$plainPass = $null
Remove-Variable -Name plainPass -Force
}

$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
$headers.Add("Content-Type", "application/json")
$headers.Add("Accept", "application/json")
$headers.Add("Authorization", "Basic $base64AuthInfo")
$path = "applications/execution/services/engine/blocks/packages/versions/executions/flows/workspaces/blocks/logging"
$body = @"
$loglevel
"@

$response = Invoke-RestMethod "https://${serverFQDN}:$APIGatewayPort/api/v1/default/default/$path" -Method PUT -Headers $headers -Body $body
$response
```

1. Configure the following variables:
* `$serverFQDN` – The fully qualified domain name for the Application Server or Load Balancer
* `$APIGatewayPort` – {{% ctx %}} API Gateway Service Port (8722) or Load Balancer port (typically 443 or 8722)
* `$loglevel` – Desired log level as an integer, `1` is enabled and `4` is the default error level
* `$user` – {{% ctx %}} API Gateway Basic Auth Username

1. Execute the script, entering the Basic Auth User's password when prompted.
1. Confirm success response:

If the call was successful, there should be no errors and the following response should be received

``` powershell
LogLevel was successfully configured.
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
---
title: "Change Flow Logging Level"
linkTitle: "Change Flow Logging Level"
description: "Instructions on how to change the Logging Level for Flow Logging."
weight: 1
---

# {{% param title %}}

To change the Logging Level for Flow Logging, the below PowerShell script can be used to make a REST call against your {{% ctx %}} platform.

1. Run Windows PowerShell ISE as Administrator.
1. Copy the following script into the PowerShell window:

``` powershell
$serverFQDN = "server.domain.com"
$APIGatewayPort = 8722
$loglevel = 4
$user = "BasicAuthUser"

$securePass = Read-Host -Prompt "Enter password for $user" -AsSecureString

$ptr = [Runtime.InteropServices.Marshal]::SecureStringToBSTR($securePass)
try {
$plainPass = [Runtime.InteropServices.Marshal]::PtrToStringBSTR($ptr)

$authBytes = [System.Text.Encoding]::ASCII.GetBytes("$user`:$plainPass")
$base64AuthInfo = [Convert]::ToBase64String($authBytes)
}
finally {
[Runtime.InteropServices.Marshal]::ZeroFreeBSTR($ptr)

$plainPass = $null
Remove-Variable -Name plainPass -Force
}

$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
$headers.Add("Content-Type", "application/json")
$headers.Add("Accept", "application/json")
$headers.Add("Authorization", "Basic $base64AuthInfo")
$path = "applications/execution/services/engine/blocks/packages/versions/executions/flows/logging"
$body = @"
$loglevel
"@

$response = Invoke-RestMethod "https://${serverFQDN}:$APIGatewayPort/api/v1/default/default/$path" -Method PUT -Headers $headers -Body $body
$response
```

1. Configure the following variables:
* `$serverFQDN` – The fully qualified domain name for the Application Server or Load Balancer
* `$APIGatewayPort` – {{% ctx %}} API Gateway Service Port (8722) or Load Balancer port (typically 443 or 8722)
* `$loglevel` – Desired log level as an integer, `1` is enabled and `4` is the default error level
* `$user` – {{% ctx %}} API Gateway Basic Auth Username

1. Execute the script, entering the Basic Auth User's password when prompted.
1. Confirm success response:

If the call was successful, there should be no errors and the following response should be received

``` powershell
LogLevel was successfully configured.
```
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ weight: 10
| Component | Purpose | Required/Optional |Server Role |
|-----------|---------|----------|------------|
| [Grafana][] | Web application that provides querying and visualisation of data in the form of dashboards. | Required | Grafana&nbsp;Cloud&nbsp;managed&nbsp;service |
| [Grafana Alloy][] | An observability collector that can ingest logs and send them to a Grafana Loki instance. It should be deployed to every machine that has a Microsoft Service Fabric node used by {{% ctx %}}. | Required | Application&nbsp;Server |
| [Grafana&nbsp;Loki][Grafana Loki] | Log aggregation system designed to store and query logs from applications and infrastructure. | Required | Grafana&nbsp;Cloud&nbsp;managed&nbsp;service |
| [Promtail][] | An agent which ships the contents of local logs to a Grafana Loki instance. It should be deployed to every machine that has a Microsoft Service Fabric node used by {{% ctx %}}. | Required | Application&nbsp;Server |

## Recommended Architecture

Expand All @@ -27,6 +27,6 @@ The following architecture requires 1..n Application servers and 1 [Grafana Clou

[Prerequisites]: {{< url path="Cortex.GettingStarted.Cloud.AddObservabilityToInnovation.Grafana.Prerequisites.MainDoc" >}}
[Grafana]: {{< url path="Grafana.Products.Grafana.MainDoc" >}}
[Grafana Alloy]: {{< url path="Grafana.Products.Loki.Alloy.MainDoc" >}}
[Grafana Cloud]: {{< url path="Grafana.MainDoc" >}}
[Grafana Loki]: {{< url path="Grafana.Products.Loki.MainDoc" >}}
[Promtail]: {{< url path="Grafana.Products.Loki.Promtail.MainDoc" >}}
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,18 @@ Please ensure that the set up for [Grafana][] and [Loki][] have been completed b
1. Click the Dashboards menu item.
1. Click the *New* dropdown and select *Import*.
1. Click on *Upload dashboard JSON file*.
1. Locate the `Flow Execution Requests.json` file extracted from the downloaded `Grafana.Dashboards.zip`.
1. Locate the `Flow Execution Details.json` file extracted from the downloaded `Grafana.Dashboards.zip`.
1. Select the file and click *Open*.
1. Select the folder in Grafana you wish the dashboard to be saved in, e.g. *Cortex*.
1. Select your [configured Loki data source][] from the dropdown menu, e.g. *grafanacloud-cortex-logs*.
1. Click *Import*.
1. Repeat steps 2 - 10 for the `Flow Execution Requests.json` file.
1. Repeat steps 2 - 10 for the `Platform Health.json` file.

{{% alert title="Warning" color="warning" %}}
The *Flow Execution Details* dashboard will only work if `Flow Logging` is enabled on your platform. See {{< ahref path="Cortex.Faqs.ChangeLoggingLevels.FlowLogging.MainDoc" title="Change Flow Logging Level" >}} for instructions on how to do this.
{{% / alert %}}

## Configure Data Sources

It is necessary to update the Custom Filter inside the dashboards to use the correct data source.
Expand All @@ -57,7 +62,7 @@ To do this, follow these steps for all default {{% ctx %}} dashboards imported:
1. Select your [configured Loki data source][] in the *Adhoc Options* > *Data source* drop-down menu, e.g. *grafanacloud-cortex-logs*.
1. Click *Apply*.
1. Click the dashboard name in the breadcrumb at the top left corner of the page to go back to the dashboard.
1. Click the + icon next to the Custom Filter to confirm that a list of available filter options is visible. If Grafana Loki has not received any logs from Promtail there will be no options available for selection.
1. Click the + icon next to the Custom Filter to confirm that a list of available filter options is visible. If Grafana Loki has not received any logs from Grafana Alloy there will be no options available for selection.
1. Repeat steps 2 - 9 for all additional default dashboards.

## Next Steps?
Expand All @@ -66,6 +71,6 @@ To do this, follow these steps for all default {{% ctx %}} dashboards imported:

[configured Loki data source]: {{< url path="Cortex.GettingStarted.Cloud.AddObservabilityToInnovation.Grafana.SetupLoki.MainDoc" >}}
[Grafana]: {{< url path="Cortex.GettingStarted.Cloud.AddObservabilityToInnovation.Grafana.SetupGrafana.MainDoc" >}}
[Grafana.Dashboards.zip]: {{< url path="GitHub.Cortex.Observability.3_0_0.GrafanaDashboardsZip" >}}
[Grafana.Dashboards.zip]: {{< url path="GitHub.Cortex.Observability.5_0_0.GrafanaDashboardsZip" >}}
[Loki]: {{< url path="Cortex.GettingStarted.Cloud.AddObservabilityToInnovation.Grafana.SetupLoki.MainDoc" >}}
[Try it Out]: {{< url path="Cortex.GettingStarted.Cloud.AddObservabilityToInnovation.Grafana.TryItOut.MainDoc" >}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
title: "Install Grafana Alloy"
linkTitle: "Install Grafana Alloy"
description: "Information about installing and configuring Grafana Alloy on the Application Server(s)."
weight: 50
---
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
title: "Configure Grafana Alloy"
linkTitle: "Configure Grafana Alloy"
description: "Information about configuring Grafana Alloy on the Application Server(s)."
weight: 20
---

# {{% param title %}}

This guide describes how to configure Grafana Alloy on the Application Server(s).

{{% alert type="note" title="Note" %}}These steps must be performed for every Grafana Alloy installation in the cluster.{{% /alert %}}

## Configure Grafana Alloy

1. Open the `config.alloy` configuration file, which is located in the folder alongside the `alloy-installer-windows-amd64.exe` file.
1. Set the `__path__` in the `local.file_match "ApiGateway"` > `path_targets` section to the path of the `Logs` folder for the API Gateway Service, e.g. `"C:/ProgramData/Cortex/API Gateway Service/Logs/**/ServiceFabricHttpEventLog-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]{,_[0-9][0-9][0-9]}.json"`.
1. Set the `__path__` in the `local.file_match "ExecutionService"` > `path_targets` section to the path of the `Logs` folder for the Execution Service, e.g. `"C:/ProgramData/Cortex/Execution Service/Logs/**/*.json"`.
1. Set the Grafana Loki `url` in the `loki.write "default"` > `endpoint` section, which can be found at the end of the file, with the url value noted down during the [Setup Grafana Loki][] steps.

A correct URL should be similar to `https://239948:eyJrIjoiaWVjNzE4MmVjOThkNTgxMMQ5MzIyZjdlMjAyYWY4NWJjO1I1OTc4NSIsIm4iOiJUZXN0S2V5IiwiaWQiOjY4Nzk0MX0=@logs-prod-008.grafana.net/api/prom/push`.
1. Delete the line containing `bearer_token_file` in the `loki.write "default"` > `endpoint` section, which can be found at the end of the file.
1. Save the file.

### Re-Start the Grafana Alloy Service

1. Open `services.msc`.
1. Locate the `Alloy` service.
1. Right click on the service name and select `Restart`. If the service is not already running, select `Start`.

## Next Steps?

1. [Import Dashboards][]

[Import Dashboards]: {{< url path="Cortex.GettingStarted.Cloud.AddObservabilityToInnovation.Grafana.ImportDashboards.MainDoc" >}}
[Setup Grafana Loki]: {{< url path="Cortex.GettingStarted.Cloud.AddObservabilityToInnovation.Grafana.SetupLoki.SetUpGrafanaLoki" >}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
title: "Install Grafana Alloy"
linkTitle: "Install Grafana Alloy"
description: "Information about installing Grafana Alloy on the Application Server(s)."
weight: 10
---

# {{% param title %}}

This guide describes how to install Grafana Alloy on the Application Server(s). Please ensure that the [Prerequisites][] have been completed before starting this installation.

## Install Grafana Alloy

1. Download the [Grafana Alloy 1.15.1][] archive.
1. Extract content of the downloaded archive to a suitable location, e.g. `C:\ProgramData\Cortex\Observability\Grafana Alloy`.
1. Download the [Grafana Alloy.zip][] archive and extract its contents alongside the previously extracted Grafana Alloy `alloy-installer-windows-amd64.exe`.
This archive contains the `config.alloy` configuration file and PowerShell scripts to install Grafana Alloy as a Windows service.
1. Run Windows PowerShell as Administrator
1. Change the location to where all the files were extracted to in step 2, e.g. `cd "C:\ProgramData\Cortex\Observability\Grafana Alloy"`.
1. Execute the `.\Install-Alloy.ps1` command to install the downloaded `alloy-installer-windows-amd64.exe` as a service.
1. When prompted, enter the credentials that the Grafana Alloy Service should run as.
1. When prompted to enter the bearer token, leave it blank and press Enter.

## Next Steps?

1. [Configure Grafana Alloy][]

[Configure Grafana Alloy]: {{< url path="Cortex.GettingStarted.Cloud.AddObservabilityToInnovation.Grafana.InstallAlloy.ConfigureAlloy.MainDoc" >}}
[Grafana Alloy 1.15.1]: {{< url path="Grafana.SelfManaged.Downloads.GrafanaAlloy.1_15_1.Windows" >}}
[Grafana Alloy.zip]: {{< url path="GitHub.Cortex.Observability.5_0_0.GrafanaAlloyInstallZip" >}}
[Prerequisites]: {{< url path="Cortex.GettingStarted.OnPremise.AddObservabilityToInnovation.Grafana.Prerequisites" >}}

This file was deleted.

Loading
Loading