copy to:https://www.cnblogs.com/uptothesky/p/5864863.htmlhtml
本地部署官方wikijava
java -version 若是報錯的話有不少種可能,搜索一下會有解決方案,個人就是在C:\Windows\System32 目錄下把java.exe更名成javaa.exe,再次cmd運行就成功了
started 就說明成功了,打開http://localhost:9200/就能看到相關信息,若是es是部署服務的話複製到config目錄中,執行
service.bat install|remove|start|stop|manager
1.偷懶法git
在ExceptionLess文件解壓目錄找到 :Start.bat 運行,o'k 佈置好了github
而後在下面看如何修改網站配置文件web
PASS:api
①命令不能執行:https://www.jb51.net/article/95022.htmoracle
2.標準法app
前兩天看到了這篇文章,親身體會了下,確實不錯,按照官方的文檔試了試本地部署,折騰一番後終於成功,記下心得在此,不敢獨享。less
Install-Package Exceptionless
在Main中寫測試代碼:elasticsearch
//ExceptionlessClient.Default.Startup("qnN5lVebQ7LA94Erkthtkq5z57xX5Wg7ZzafiMdZ"); var client = new ExceptionlessClient(c => { c.ApiKey = "oXX5BJqhS30ni045BqthqJtiSnpB0naMactfmYmI"; c.ServerUrl = "http://localhost:8004"; }); try { throw new Exception("test exception "+DateTime.Now.ToString("yyyy-MM-dd HH-mm-ss")); } catch (Exception ex) { client.SubmitException(ex); //ex.ToExceptionless().Submit(); Console.WriteLine("error send"); } Console.ReadKey();
這裏須要注意註釋掉的部分,或者是以下調用:
using Exceptionless.Configuration; [assembly: Exceptionless("oXX5BJqhS30ni045BqthqJtiSnpB0naMactfmYmI", ServerUrl = "http://localhost:8004")] namespace ExceptionTest { class Program { static void Main(string[] args) { ExceptionlessClient.Default.Startup("oXX5BJqhS30ni045BqthqJtiSnpB0naMactfmYmI"); //var client = new ExceptionlessClient(c => { // c.ApiKey = "oXX5BJqhS30ni045BqthqJtiSnpB0naMactfmYmI"; // c.ServerUrl = "http://localhost:8004"; //}); try { throw new Exception("test exception "+DateTime.Now.ToString("yyyy-MM-dd HH-mm-ss")); } catch (Exception ex) { //client.SubmitException(ex); ex.ToExceptionless().Submit(); Console.WriteLine("error send"); } Console.ReadKey(); } } }
api-key指定兩次,也能夠經過。
使用config配置:
<configuration> <configSections> <section name="exceptionless" type="Exceptionless.ExceptionlessSection, Exceptionless" /> </configSections> <exceptionless apiKey="oXX5BJqhS30ni045BqthqJtiSnpB0naMactfmYmI" serverUrl="http://localhost:8004" /> </configuration>
using Exceptionless.Configuration; //[assembly: Exceptionless("oXX5BJqhS30ni045BqthqJtiSnpB0naMactfmYmI", ServerUrl = "http://localhost:8004")] namespace ExceptionTest { class Program { static void Main(string[] args) { ExceptionlessClient.Default.Startup("oXX5BJqhS30ni045BqthqJtiSnpB0naMactfmYmI"); //var client = new ExceptionlessClient(c => { // c.ApiKey = "oXX5BJqhS30ni045BqthqJtiSnpB0naMactfmYmI"; // c.ServerUrl = "http://localhost:8004"; //}); try { throw new Exception("test exception "+DateTime.Now.ToString("yyyy-MM-dd HH-mm-ss")); } catch (Exception ex) { //client.SubmitException(ex); ex.ToExceptionless().Submit(); Console.WriteLine("error send"); } Console.ReadKey(); } } }
這樣就不須要在using那指定了。
接下來就能夠在http://localhost:8004/#/type/error/dashboard中看到異常信息了。