An open API service indexing awesome lists of open source software.

https://github.com/nethereum/nethereumnlogsample

Logging trace requests example using nlog
https://github.com/nethereum/nethereumnlogsample

Last synced: about 1 year ago
JSON representation

Logging trace requests example using nlog

Awesome Lists containing this project

README

          

# Nethereum Nlog Sample
Logging trace requests example using nlog

![image](https://user-images.githubusercontent.com/562371/194052239-bd1eb109-366a-4ff1-bccf-9762cf27527d.png)

Nethereum uses **"Trace"** to log requests and responses, so the configuration needs to be configured as such.

More info on setup Nlog can be found here: https://github.com/NLog/NLog/wiki/Getting-started-with-.NET-Core-2---Console-application#a-minimal-example

**Example configuration file:**

```xml









```
**Simple program**
```csharp
var logger = LoggerFactory.Create(builder => builder.AddNLog()).CreateLogger();
logger.LogInformation("hello info!");
logger.LogTrace("hello trace!");
var web3 = new Web3("http://localhost:8545", logger);
var blocknumber = await web3.Eth.Blocks.GetBlockNumber.SendRequestAsync();
Console.ReadLine();
```