. Net Open Source Exception Log exceptionless build

Source: Internet
Author: User

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:

    1. Download the release pack on GitHub to install it.

Installation Environment
    1. Window10
    2. VS2017
    3. IIS8.5
    4. Java
    5. ElasticSearch1.7.5
    6. exceptionless.3.4.2523

  

Installation steps
  1. Unzip the ZIP package, including the file
  2. Decompression Elasticsearch

  3. Copy the elasticsearch.prod.yml and elasticsearch.yml files inside the exceptionless into the Elasticsearch Extract Directory Bin folder,

  4. 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
  5. Run the Start.bat batch file in the Exceptionless file as an administrator to start the installation

  6. 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

  7. Open several pages as shown, then on the Exceptionless page, click the Register button to register an account and then log in

  8. 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.

  9. Enter the project type configuration interface below and select the ASP. 1.select your project Types drop-down box

  10. 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
  1. Create a new Netcore API project
  2. 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

  3. 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 (); }    }}

  4. 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) {} }}

  5. . 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

  6. Click to enter to see more information

. Net Open Source Exception Log exceptionless build

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.