Guest User

Untitled

a guest
Jul 18th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. public Startup(IConfiguration configuration, IHostingEnvironment hostingEnvironment)
  2. {
  3. const string esUrl = "https://aws-es-thinger.us-west-1.es.amazonaws.com";
  4. Log.Logger = new LoggerConfiguration()
  5. .Enrich.FromLogContext()
  6. .Enrich.WithExceptionDetails()
  7. .WriteTo.Elasticsearch(new ElasticsearchSinkOptions(new Uri(esUrl))
  8. {
  9. ModifyConnectionSettings = conn =>
  10. {
  11. var httpConnection = new AwsHttpConnection("us-east-1");
  12. var pool = new SingleNodeConnectionPool(new Uri(esUrl));
  13. var conf = new ConnectionConfiguration(pool, httpConnection);
  14. return conf;
  15. },
  16. AutoRegisterTemplate = true
  17. })
  18. .CreateLogger();
  19. }
Add Comment
Please, Sign In to add comment