Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public Startup(IConfiguration configuration, IHostingEnvironment hostingEnvironment)
- {
- const string esUrl = "https://aws-es-thinger.us-west-1.es.amazonaws.com";
- Log.Logger = new LoggerConfiguration()
- .Enrich.FromLogContext()
- .Enrich.WithExceptionDetails()
- .WriteTo.Elasticsearch(new ElasticsearchSinkOptions(new Uri(esUrl))
- {
- ModifyConnectionSettings = conn =>
- {
- var httpConnection = new AwsHttpConnection("us-east-1");
- var pool = new SingleNodeConnectionPool(new Uri(esUrl));
- var conf = new ConnectionConfiguration(pool, httpConnection);
- return conf;
- },
- AutoRegisterTemplate = true
- })
- .CreateLogger();
- }
Add Comment
Please, Sign In to add comment