Advertisement
Guest User

Untitled

a guest
Mar 29th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. var elasticUri = new Uri("http://localhost:9200/cmstest/zdsf");
  2.  
  3. var loggerConfig = new LoggerConfiguration()
  4. .WriteTo.Elasticsearch(new ElasticsearchSinkOptions(elasticUri)
  5. {
  6. AutoRegisterTemplate = true
  7. });
  8.  
  9. zdsf z = new zdsf();
  10.  
  11. z.filedate = DateTime.Now;
  12. z.filename = "File2";
  13.  
  14. var logger = loggerConfig.CreateLogger();
  15.  
  16. var jsonString = new JavaScriptSerializer().Serialize(z);
  17.  
  18. logger.Error(jsonString);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement