{"id":17757835,"url":"https://github.com/paralleltask/nlog.resttarget","last_synced_at":"2025-05-12T15:44:47.743Z","repository":{"id":138439069,"uuid":"121047665","full_name":"ParallelTask/Nlog.RestTarget","owner":"ParallelTask","description":"HTTP Rest Target for NLog","archived":false,"fork":false,"pushed_at":"2018-02-13T20:16:18.000Z","size":1569,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-19T03:11:34.379Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ParallelTask.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2018-02-10T19:39:00.000Z","updated_at":"2024-02-19T07:02:07.000Z","dependencies_parsed_at":null,"dependency_job_id":"b74d662e-40ee-4cfa-861b-b5a18f8971bb","html_url":"https://github.com/ParallelTask/Nlog.RestTarget","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/ParallelTask%2FNlog.RestTarget","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ParallelTask%2FNlog.RestTarget/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ParallelTask%2FNlog.RestTarget/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ParallelTask%2FNlog.RestTarget/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ParallelTask","download_url":"https://codeload.github.com/ParallelTask/Nlog.RestTarget/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253767523,"owners_count":21961124,"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-10-26T17:09:05.540Z","updated_at":"2025-05-12T15:44:47.710Z","avatar_url":"https://github.com/ParallelTask.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NLog.RestTarget\n## What\nRest API logging with NLog made easy. Generates log entries as JSON. XML is not supported yet. These entries can be sent over to RestApis. \n\n## What problems does this solve?\nWebservice Target of NLog does not support JSON Layout https://github.com/NLog/NLog/issues/1905. It requires atleast one root parameter as below example\n\n```\n\u003ctarget xsi:type=\"WebService\"\u003e\n\u003cheader name=\"Custom\" layout=\"${mdlc:item=xxx}\"/\u003e \u003c!-- Introduced in NLog 4.5 --\u003e\n\u003cparameter name=\"root\"\u003e\n  \u003clayout xsi:type=\"JsonLayout\" includeAllProperties=\"true\"\u003e\n     \u003cattribute name=\"Message\" layout=\"${message}\" /\u003e\n  \u003c/layout\u003e\n\u003c/parameter\u003e\n\u003c/target\u003e\n```\n\nNLog.RestTarget solves these problems. You don't require to add root parameter for JSON Layout.\n\n## How to use it\n1. Install the **NLog.RestTarget** package from NuGet\n2. Add **NLog.RestTarget** to NLog extensions\n\n```\n\u003cnlog xmlns=\"http://www.nlog-project.org/schemas/NLog.xsd\"\u003e\n  \u003cextensions\u003e\n    \u003cadd assembly=\"NLog.RestTarget\" /\u003e\n  \u003c/extensions\u003e\n-----\n\u003c/nlog\u003e\n```\n\n3. Add to NLog targets\n\n```\n\u003ctargets\u003e\n  \u003ctarget name=\"wse\" xsi:type=\"RestService\" host=\"http://localhost:59802/api/hello/indexer\"\u003e    \n    \u003cheader name=\"Custom\" layout=\"${mdlc:item=xxx}\"/\u003e\n    \u003clayout xsi:type=\"JsonLayout\" includeAllProperties=\"true\"\u003e\n      \u003cattribute name=\"Level\" layout=\"${level}\" /\u003e\n      \u003cattribute name=\"Timestamp\" layout=\"${longdate}\" /\u003e\n      \u003cattribute name=\"Message\" layout=\"${message}\" /\u003e\n    \u003c/layout\u003e\n  \u003c/target\u003e\n\u003c/targets\u003e\n ````\n \n```\u003cparameter /\u003e``` is not supported. NLog.RestTarget only solves the JSON Layout problem.\n\n## Known Issues\n \n1. Supports only JSON body.\n2. Supports only HTTP Post Verb.\n \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparalleltask%2Fnlog.resttarget","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fparalleltask%2Fnlog.resttarget","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparalleltask%2Fnlog.resttarget/lists"}