You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The above code will register one sink, the Elasticsearch sink, with a reference to the ES server located on the localhost and port 9200. We also set the option AutoRegisterTemplate to true. This will create the correct mapping for us at startup.
Next, we will write some events to Serilog.
logger.Error(newException("test"),"An error has occurred.");logger.Information("The {User} has just executed {Action}.","username","actionName");
This will write two events to Serilog which will deliver those to the registered sinks. In this case the Elasticsearch one and your two events will end up in Elasticsearch.