?????????
????1.???????????????????????????????????????????????????Ч??????????????г????????????????豸??
????2.???ID???????????????????????????????????????????????????ó??????????????ó??????????????????
????3.???????????“????”???????????????????????????????????????棬??????????????????????????
????4.???????????????????????????????
????5.???????????????????????????????????????????????o?BDD???????
????????????????????????????????????????????????????????1???????????????????????????????????????ID????????????????????????????????????????????ó???????????????????????????????????????????????????????????????????м???????????????????????????????????????????????????????????????????????????
???????????????????????????
???????????????????????????????“????”????????????????????I / O?????????洢????????????????????????Щ?????????????????????????????????????????????????????е?????м?????????????????????????????????????I/O??SSD?洢???????????1GB??10GB??????100Gb????????????飬??????????????????????ò????
???????????????????????ó????????????????????????????£?????????????????????????????????????????????????????????????????????IoT????????£????????????????????????????????????????????“?????????”??Mean Time to Recovery??MTTR???????????????????????Σ????????????????????????????????
??????????????????????——????ElasticSearch??Logstash??Kibana??LogEntries??Loggly??Sematext???——??????????????????????????????н??????????????????????ж???ó??????????????????REST API?????????????????????????????

??????????????????????????????????????????5%-10%????????????????λ?t???????????????????????????????????????????????????????????????????????????????Щ????÷????????????
?????????I / O??洢?????????????????——???????й??????????в???????????????????????????????????????????????????????????????????????????????????????????????????????????????????β????????
?????????????????
?????????????????????????????????????Щ???????????????????ID???????????????????????Щ?????????????????????????????????????????????????????????????????漰?????????????????????????????????????????

???????????????????????????????Щ????????“??????”??“??????”??“?????”??????Щ????????????????????????????????????????????????????ID??——???ID??

???????????????????????У????????????????????????????粻??????????????????????????????????????????????Щ????????????ID????????Щ???ID???????????????????????????
?????????????????ID?????
???????????e???仨????????????????????????log4net??log4j????????????ü????????????д??????????????????????壬????????????????????????ü??о?????????????????????????
????1.??????????????????????????????????
????2.????????????????ID??????????????????
????3.??????????????????Info??Error??Debug???——???????????????????????????
?????????????????Щ?????????????????????????????????????????????????????????????????????????????????????????????????“??????”???????????????????????????????????
?????????????????????????ID????Щ???????ID????????????????????????????????е???????????????????ID?????????????????????????ApplicationStarted??DatabaseConnectionFailed??DocumentStoreUnavailable??????????????????Щ?????????????????????ID??????????????????п???????????
???????磬?????????????C#??????????????ó???????????
????public enum EventID
????{
????// Badly-initialised logging data
????NotSet = 0??
????// An unrecognised event has occurred
????UnexpectedError = 10000??
????ApplicationStarted = 20000??
????ApplicationShutdownNoticeReceived = 20001??
????PageGenerationStarted = 30000??
????PageGenerationCompleted = 30001??
????MessageQueued = 40000??
????MessagePeeked = 40001??
????BasketItemAdded = 60001??
????BasketItemRemoved = 60002??
????CreditCardDetailsSubmitted = 70001??
????// ...
????}
?????????????????????????????????????????????ID???????????????????????????????????????????й?“????”?????????????60000??69999????????ID??????????????????д??????????????????????????????ID????????????????д?????????С??????????????????????????????????????????????????????API????á?

??????????????????????????????????????????????????????????????????????curl?????????API?????????в????
???????磬??????????鷢?????????????????????????DatabasePreQuery ??DatabasePostQuery????????г?????????????????DatabaseConnectionFailed????
???????????DatabasePreQuery??????????????GitHub??????????Elasticsearch API ??????????У???curl????
????$ curl -XGET 'http://localhost:9200/_search?q=message:DatabasePreQuery&pretty'
????????????????????????磨????????????????????????????????????ο?????
????{
????2    "took" : 19??
????3    "timed_out" : false??
????4    "_shards" : {
????5      "total" : 20??
????6      "successful" : 20??
????7      "failed" : 0
????8    }??
????9    "hits" : {
????10     "total" : 1??
????11     "max_score" : 11.516103??
????12     "hits" : [ {
????13       "_index" : "logstash-2016.05.06"??
????14       "_type" : "logs"??
????15       "_id" : "gHEKyHasRb6GaUhM1gywpg"??
????16       "_score" : 11.516103??
????17       "_source":{"message":
????18                    "[2016-05-06 17:07:42] slim-skeleton.INFO: DatabasePreQuery [] []"??
????19                    "@version":"1"??
????20                    "@timestamp":"2016-05-06T16:07:42.749Z"??
????21                    "host":"vagrant-ubuntu-trusty-64"??
????22                    "path":"/var/www/wibble/logs/app.log"}
????23    } ]
????24  }
????24
????25 }