I want to write my .net core server'S logs to a Rest-api by using Serilogger. I've checked several ways, and tried Seq sink by giving my rest api's url. But it does not work effectively. Is there any rest api sink for that? Thanks for helping
"Serilog": {
"Using": [ "Serilog", "Serilog.Sinks.Console", "Serilog.Sinks.Seq" ],
"MinimumLevel": {
"Default": "Verbose",
"Override": {
"System": "Information",
"Microsoft": "Information",
"Microsoft.EntityFrameworkCore": "Information"
}
},
"WriteTo": [
{
"Name": "Seq",
"Args": {
"serverUrl": "http://localhost:6010",
"apiKey": "none",
"restrictedToMinimumLevel": "Verbose"
}
},
{
"Name": "Async",
"Args": {
"configure": [
{
"Name": "Console",
"Args": {
"restrictedToMinimumLevel": "Information"
}
}
]
}
}
],
You can try Serilog.Sinks.Http, a Serilog sink for sending log events over HTTP.
Below is an example of a hypothetical JSON payload:
{
"events": [
{
"Timestamp": "2020-03-31T00:05:30.4899425-03:00",
"Level": "Information",
"MessageTemplate": "Logging {@Heartbeat} from {Computer}",
"RenderedMessage": "Logging { UserName: \"augustoproiete\", UserDomainName: \"XLSTACK\" } from \"Workstation\"",
"Properties": {
"Heartbeat": {
"UserName": "augustoproiete",
"UserDomainName": "XLSTACK"
},
"Computer": "Workstation"
}
},
{
"Timestamp": "2020-03-31T00:09:12.4905685-03:00",
"Level": "Information",
"MessageTemplate": "Logging {@Heartbeat} from {Computer}",
"RenderedMessage": "Logging { UserName: \"augustoproiete\", UserDomainName: \"XLSTACK\" } from \"Workstation\"",
"Properties": {
"Heartbeat": {
"UserName": "augustoproiete",
"UserDomainName": "XLSTACK"
},
"Computer": "Workstation"
}
}
]
}
In Serilog's wiki you can find a list of sinks developed and supported by the wider Serilog community: https://github.com/serilog/serilog/wiki/Provided-Sinks