{"id":19903211,"url":"https://github.com/nethereum/nethereumnlogsample","last_synced_at":"2026-05-13T04:36:38.874Z","repository":{"id":89828957,"uuid":"546021294","full_name":"Nethereum/NethereumNlogSample","owner":"Nethereum","description":"Logging trace requests example using nlog","archived":false,"fork":false,"pushed_at":"2022-10-05T11:49:25.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-11T21:24:40.809Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Nethereum.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-10-05T11:39:52.000Z","updated_at":"2023-01-12T14:48:45.000Z","dependencies_parsed_at":null,"dependency_job_id":"e3a06bfb-249d-4cdc-bff0-c3ff0558ef54","html_url":"https://github.com/Nethereum/NethereumNlogSample","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nethereum%2FNethereumNlogSample","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nethereum%2FNethereumNlogSample/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nethereum%2FNethereumNlogSample/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nethereum%2FNethereumNlogSample/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Nethereum","download_url":"https://codeload.github.com/Nethereum/NethereumNlogSample/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241330762,"owners_count":19945231,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-12T20:22:31.779Z","updated_at":"2026-05-13T04:36:38.825Z","avatar_url":"https://github.com/Nethereum.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Nethereum Nlog Sample\nLogging trace requests example using nlog\n\n\n\n![image](https://user-images.githubusercontent.com/562371/194052239-bd1eb109-366a-4ff1-bccf-9762cf27527d.png)\n\nNethereum uses **\"Trace\"** to log requests and responses, so the configuration needs to be configured as such. \n\nMore 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\n\n**Example configuration file:**\n\n```xml\n\u003c?xml version=\"1.0\" encoding=\"utf-8\" ?\u003e\n\u003c!-- XSD manual extracted from package NLog.Schema: https://www.nuget.org/packages/NLog.Schema--\u003e\n\u003cnlog xmlns=\"http://www.nlog-project.org/schemas/NLog.xsd\" xsi:schemaLocation=\"NLog NLog.xsd\"\n      xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n      autoReload=\"true\"\n      internalLogFile=\"c:\\temp\\console-example-internal.log\"\n      internalLogLevel=\"Trace\" \u003e\n\n\t\u003c!-- the targets to write to --\u003e\n\t\u003ctargets\u003e\n\t\t\u003c!-- write logs to file --\u003e\n\t\t\u003ctarget xsi:type=\"File\" name=\"logfile\" fileName=\"c:\\temp\\console-example.log\"\n\t\t\t\tlayout=\"${longdate}|${level}|${message} |${all-event-properties} ${exception:format=tostring}\" /\u003e\n\t\t\u003ctarget xsi:type=\"Console\" name=\"logconsole\"\n\t\t\t\tlayout=\"${longdate}|${level}|${message} |${all-event-properties} ${exception:format=tostring}\" /\u003e\n\t\u003c/targets\u003e\n\n\t\u003c!-- rules to map from logger name to target --\u003e\n\t\u003crules\u003e\n\t\t\u003clogger name=\"*\" minlevel=\"Trace\" writeTo=\"logfile,logconsole\" /\u003e\n\t\u003c/rules\u003e\n\u003c/nlog\u003e\n```\n**Simple program**\n```csharp\nvar logger = LoggerFactory.Create(builder =\u003e builder.AddNLog()).CreateLogger\u003cProgram\u003e();\nlogger.LogInformation(\"hello info!\");\nlogger.LogTrace(\"hello trace!\");\nvar web3 = new Web3(\"http://localhost:8545\", logger);\nvar blocknumber = await web3.Eth.Blocks.GetBlockNumber.SendRequestAsync();\nConsole.ReadLine();\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnethereum%2Fnethereumnlogsample","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnethereum%2Fnethereumnlogsample","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnethereum%2Fnethereumnlogsample/lists"}