Tag: PAC CFile renamed CTO Reference installation Environment Let SEL httpd
Exceptionless is a free open source distributed Log collection framework, dotnet almost all types of programs can be supported, and also provides an interface, can be easily in the JS log push.
Reference:
Http://www.cnblogs.com/uptothesky/p/5864863.html
Http://www.cnblogs.com/savorboard/p/exceptionless.html
http://mp.weixin.qq.com/s?__biz=MzAwNTMxMzg1MA==&mid=2654067937&idx=1&sn= 01e502d9ef5cf77817aa80db6903923d&scene=0#wechat_redirect
Installation Instructions
The exceptionless is divided into two types:
- Download the release pack on GitHub to install it.
Installation Environment
- Window10
- VS2017
- IIS8.5
- Java
- ElasticSearch1.7.5
- exceptionless.3.4.2523
Installation steps
- Unzip the ZIP package, including the file
Decompression Elasticsearch
- Copy the elasticsearch.prod.yml and elasticsearch.yml files inside the exceptionless into the Elasticsearch Extract Directory Bin folder,
- Java JDK 1.8+ After installation also need to configure the next Java environment, system variables added: java_home corresponding C:\Program files\java\jdk1.8.0_102 is the directory where the JDK is installed, user variable path added%java_home %\bin; When the configuration is complete, open cmd, run
-Version If there are many possible error, search will have a solution, I was in the C:\Windows\System32 directory to rename Java.exe to Javaa.exe, again cmd run succeeded
- Run the Start.bat batch file in the Exceptionless file as an administrator to start the installation
- If all is successfully installed, several pages will be opened automatically for you. Let's take a look at the directory structure, as shown in the default installation Elasticsearch is 5.5.2 installed Kibana version is also 5.5.2
- Open several pages as shown, then on the Exceptionless page, click the Register button to register an account and then log in
- After successful registration, enter the following interface, enter the two text boxes, the organization name and the project name to classify the exceptions of our project.
- Enter the project type configuration interface below and select the ASP. 1.select your project Types drop-down box
- The following interface appears, stating that the configuration is complete and the instructions for use are given. The installation configuration to this exceptionless has been completed.
Net Core Project Demo
- Create a new Netcore API project
- In Package Manager, select your project, then enter "Install-package Exceptionless.aspnetcore" to install the NuGet package, or you can install it by other means
Add references in Startup.cs: Startup all code:
usingexceptionless;usingMicrosoft.AspNetCore.Builder;usingMicrosoft.AspNetCore.Hosting;usingMicrosoft.Extensions.Configuration;usingMicrosoft.Extensions.DependencyInjection;namespacewebapplication1{ Public classStartup { PublicStartup (iconfiguration configuration) {Configuration=configuration; } PublicIConfiguration Configuration {Get; } //This method gets called by the runtime. Use this method to add services to the container. Public voidconfigureservices (iservicecollection services) {services. Addmvc (); } //Public void Configure (Iapplicationbuilder app, Ihostingenvironment env, iloggerfactory loggerfactory)//{ //app. Useexceptionless (); //app. Useexceptionless ("Euue3tf5eqgdpybid1i3bdigt9cgxv7jszmsudlt"); // //app. Useexceptionless ("15mt6mdbaxavoq4b8v6bxikgacwmr6y3stsgs6b4"); //app. Usestaticfiles (); //app. Usemvc (); //} //This method gets called by the runtime. Use this method to configure the HTTP request pipeline. Public voidConfigure (Iapplicationbuilder app, Ihostingenvironment env) {if(env. Isdevelopment ()) {app. Usedeveloperexceptionpage (); } ExceptionlessClient.Default.Configuration.ApiKey="EUUE3TF5EQGDPYBID1I3BDIGTGXV7JSZMSUDLT"; EXCEPTIONLESSCLIENT.DEFAULT.CONFIGURATION.SERVERURL="http://localhost:50000"; App. Usemvc (); } }}
- Use the exception in the code, directly on the code bar! is to modify the next get method to test under Valuescontroller, the code is very simple
usingexceptionless;usingMICROSOFT.ASPNETCORE.MVC;usingSystem;usingSystem.Collections.Generic;namespacewebapplication1.controllers{[Route ("Api/[controller]")] Public classValuescontroller:controller {//GET api/values[HttpGet] Publicienumerable<string>Get () {Try { Throw NewException ("Test Log Demo"); } Catch(Exception ex) {ex. Toexceptionless (). Submit (); } Try { Throw NewApplicationException ("Controller--valuescontroller:"+Guid.NewGuid (). ToString ()); } Catch(Exception ex) {ex. Toexceptionless (). Submit (); } return New string[] {"value1","value2" }; } //GET API/VALUES/5[HttpGet ("{ID}")] Public stringGet (intID) {return "value"; } //POST api/values[HttpPost] Public voidPost ([Frombody]stringvalue) { } //PUT API/VALUES/5[Httpput ("{ID}")] Public voidPut (intID, [frombody]stringvalue) { } //DELETE API/VALUES/5[Httpdelete ("{ID}")] Public voidDelete (intID) {} }}
- . Run it up. Then the browser switches to the Exceptionless panel to view it, automatically refreshes the exception information, such as Http://localhost:50000/#!/type/error/dashboard
- Click to enter to see more information
. Net Open Source Exception Log exceptionless build