Skip to content

Commit b318784

Browse files
authored
Update Logging.md
1 parent b52c5cb commit b318784

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

Logging.md

+14-5
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,11 @@ Refer this [document of NLog Configuration](https://nlog-project.org/config/) fo
1616

1717
## Setup
1818

19-
In order to leverage the new logging framework, it is required to install the **`NLog.Config`** package into the .NET project. This can be done using the Package Manager, steps for which can be found on the [NuGet page for the package](https://www.nuget.org/packages/NLog.Config/).
19+
In order to leverage the new logging framework, it is required to install the **`NLog.Schema`** package into the .NET project. This can be done using the Package Manager, steps for which can be found on the [NuGet page for the package](https://www.nuget.org/packages/NLog.Config/).
2020

21-
When the **`NLog.Config`** package is installed, it will add two new files to the project — **`NLog.config`** and **`NLog.xsd`**.
21+
When the **`NLog.Schema`** package is installed, it will add new file to the project — **`NLog.xsd`**.
2222

23-
<span style="color: red;">**Note that the package name is `NLog.Config` and the name of the newly added file is `NLog.config`.**</span>
24-
25-
The **`Copy To Output Directory`** property of this `NLog.config` file needs to be set to **`Copy Always`**.
23+
Create and add the **`NLog.config`** file to main directory of your source project and sample for **`NLog.config`** file is given below:
2624

2725
## Sample NLog.config File
2826

@@ -59,13 +57,24 @@ The **`Copy To Output Directory`** property of this `NLog.config` file needs to
5957
</nlog>
6058
```
6159

60+
The **`Copy To Output Directory`** property of this `NLog.config` file needs to be set to **`Copy Always`**.
61+
Or this can be done by adding below lines to your **`Project.csproj`** file.
62+
```xml
63+
<ItemGroup>
64+
<None Update="NLog.config">
65+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
66+
</None>
67+
</ItemGroup>
68+
```
69+
6270
### Important Notes
6371

6472
* The logger name in the rule must match the **'Logger name of the Logger object'**. It can include wildcard characters (`*`, `?`).
6573
* The logger name can be the namespace from which logging statements should be honored.
6674
* In case `name="*"` is used, all logging statements from all namespaces will be written to log. This will include logging statements from inside the SDK as well.
6775
* If logging statements from inside the SDK should not be logged, provide specific namespaces in the rules.
6876
* The `minlevel` field denotes the minimum level to log. In a production environment, this may be set to `Warn`.
77+
* The variable `globalThreshold` needs to be set to `Off` in case you want to turn off the logging in Nlog.config file.
6978
* The variable `enableMasking` needs to be set to `true` if sensitive data in the request/response should be hidden/masked.
7079
* Sensitive data fields are listed below:
7180
* Card Security Code

0 commit comments

Comments
 (0)