Skip to content

Commit 0bdc9ba

Browse files
docs: add info on how to use serilog env vars to enable logging (#249)
1 parent efdce33 commit 0bdc9ba

File tree

1 file changed

+25
-4
lines changed

1 file changed

+25
-4
lines changed

dotnet-docs/logging.md

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,31 @@ The Report Server for .NET uses [Serilog](https://serilog.net/) to allow writin
1414

1515
## Setup
1616

17-
The configuration options for Serilog that would usually be set up through the C# API - [Serilog Configuration Basics](https://github.com/serilog/serilog/wiki/Configuration-Basics), can instead be
18-
defined in the `appsettings.json` configuration files of the Report Server for .NET.
17+
The configuration options for Serilog that would usually be set up through the C# API - [Serilog Configuration Basics](https://github.com/serilog/serilog/wiki/Configuration-Basics), can be configured in two ways:
1918

20-
### Report Server Manager
19+
1. [Environment Variables](#using-environment-variables) - Set system-wide environment variables.
20+
2. [Configuration Files](#using-configuration-files) - Modify the `appsettings.json` files directly.
21+
22+
### Using Environment Variables
23+
24+
You can enable logging for both the Report Server Manager and Service Agent at the same time by setting the following environment variables:
25+
26+
````
27+
Serilog__MinimumLevel=Verbose
28+
Serilog__WriteTo__1__Name=File
29+
Serilog__WriteTo__1__Args__path=Logs/rsnetlogs.txt
30+
````
31+
32+
This requires the default Serilog configuration to exist in the `appsettings.json` files for both the manager and service components, as environment variables are intended to override these base settings as needed.
33+
34+
>note When the Report Server is installed using the MSI installer, it runs under a dedicated Windows user account (ReportServerUser) or a system account (e.g., LocalSystem) depending on your installation choice. These accounts do not have access to user-level environment variables.
35+
> To ensure environment variable overrides work correctly, you must define them at the **system level**.
36+
37+
### Using Configuration Files
38+
39+
Alternatively, you can define the configuration in the `appsettings.json` configuration files of the Report Server for .NET.
40+
41+
#### Report Server Manager
2142

2243
The `appsettings.json` file of the Report Server Manager for .NET resides in its installation directory, for example, `C:\Program Files (x86)\Progress\Telerik Report Server\Telerik.ReportServer.Web.NET\`.
2344
The following configuration settings can be added to that file, at the top level:
@@ -37,7 +58,7 @@ The following configuration settings can be added to that file, at the top level
3758
}
3859
````
3960

40-
### Service Agent
61+
#### Service Agent
4162

4263
The Report Server for .NET ServiceAgent's `appsettings.json` file can be found in its installation directory, by default - `C:\Program Files (x86)\Progress\Telerik Report Server\Services\.NET\`.
4364
The following configuration settings can be added to that file, at the top level:

0 commit comments

Comments
 (0)