分布式日志:Exceptionless的安装与部署

安装步骤

  1. 首先exceptionless依赖elasticsearch,而elasticsearch需要java环境,所以先安装jdk

  2. 下载exceptionless:

    • 下载完成之后解压进入目录中:

    • 右击已管理员身份运行:Start.bat。如果报错,则用powershell进入到该目录,然后运行。他会帮我们下载elasticsearch和kabana。

  3. 进入到wwwroot文件夹中修改web.config文件:

    1. <?xml version="1.0" encoding="utf-8"?>
      <configuration>
        <connectionStrings>
            <!--exceptionless默认用户名和密码是存在内存中,这里设置存放在redis中-->
          <add name="RedisConnectionString" connectionString="" />
          <!--elasticSearch的地址-->
          <add name="ElasticSearchConnectionString" connectionString="http://localhost:9200" />
          <add name="LdapConnectionString" connectionString="" />
        </connectionStrings>
        <appSettings>
          <!-- Base url for the ui used to build links in emails and other places. -->
          <!--exceptionless的地址,注意后面一定要加个!号,不然激活邮箱的地址会失效-->
          <add key="BaseURL" value="http://localhost:50000/#!" />
          <!-- Controls whether SSL is required. Only enable this if you have SSL configured. -->
          <add key="EnableSSL" value="false" />
          <!--
          Dev: Use this mode when debugging. (Outbound emails will not be sent)
          QA: Use this mode when deployed to staging. (Outbound emails restricted)
          Production: Use this mode when deployed to production.
          -->
          <add key="WebsiteMode" value="Production" />
          <!-- Controls whether users can signup. -->
          <add key="EnableAccountCreation" value="true" />
          <!-- Controls whether daily summary emails are sent -->
          <add key="EnableDailySummary" value="true" />
          <!--
            Email Client Settings (Uncomment the section below to change the default email settings)
            There are three valid SmtpEncryption settings: None, SSL and StartTLS
          -->
          <add key="SmtpHost" value="smtp.qq.com" />
          <add key="SmtpPort" value="465" />
          <add key="SmtpEncryption" value="SSL" />
          <add key="SmtpFrom" value="1983702356@qq.com" />
          <add key="SmtpUser" value="1983702356@qq.com" />
          <add key="SmtpPassword" value="jhmvvgpwfbaoeagi" />
          
          <!-- Folder used to store event post data -->
          <add key="StorageFolder" value="|DataDirectory|\storage" />
          <!-- Runs the jobs in the current website process -->
          <add key="RunJobsInProcess" value="true" />
          <add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />
        </appSettings>
        <system.net>
          <defaultProxy enabled="true" />
        </system.net>
        <system.web>
          <authentication mode="None" />
          <compilation targetFramework="4.6" debug="false" />
          <httpRuntime targetFramework="4.6" maxRequestLength="10000" maxUrlLength="1024" />
          <customErrors mode="RemoteOnly" defaultRedirect="~/error.html" />
        </system.web>
        <system.webServer>
          <modules runAllManagedModulesForAllRequests="true">
            <remove name="FormsAuthentication" />
            <remove name="RewriteModule" />
            <remove name="RoleManager" />
            <remove name="WebDAVModule" />
          </modules>
          <urlCompression doStaticCompression="true" />
          <httpCompression directory="%SystemDrive%\websites\_compressed" minFileSizeForComp="1024">
            <scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll" />
            <staticTypes>
              <add mimeType="text/*" enabled="true" />
              <add mimeType="message/*" enabled="true" />
              <add mimeType="application/javascript" enabled="true" />
              <add mimeType="application/json" enabled="true" />
              <add mimeType="*/*" enabled="false" />
            </staticTypes>
          </httpCompression>
          <httpProtocol>
            <customHeaders>
              <remove name="Server" />
              <remove name="X-Powered-By" />
              <remove name="X-AspNet-Version" />
            </customHeaders>
          </httpProtocol>
          <handlers>
            <remove name="OPTIONS" />
            <remove name="OPTIONSVerbHandler" />
            <remove name="TRACE" />
            <remove name="TRACEVerbHandler" />
            <remove name="WebDAV" />
            <remove name="ExtensionlessUrlHandler-Integrated-4.0" />
            <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
          </handlers>
          <security>
            <requestFiltering allowDoubleEscaping="true">
              <requestLimits maxAllowedContentLength="10000000" />
            </requestFiltering>
          </security>
          <!--<rewrite><rules><clear /><rule name="Redirect HTTP to HTTPS"><match url="^(.*)$" /><conditions><add input="{HTTPS}" pattern="^OFF$" /><add input="{HTTP_HOST}" matchType="Pattern" pattern="\:9001$" negate="true" /><add input="{HTTP_HOST}" matchType="Pattern" pattern="^local-app.exceptionless.io$" negate="true" /></conditions><action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="SeeOther" /></rule><rule name="Redirect HTTPS to HTTP"><match url="^(.*)$" /><conditions><add input="{HTTPS}" pattern="^ON$" /><add input="{HTTP_HOST}" matchType="Pattern" pattern="^local-app.exceptionless.io$" /></conditions><action type="Redirect" url="http://{HTTP_HOST}/{R:1}" redirectType="SeeOther" /></rule><rule name="Redirect exceptionless.io to be.exceptionless.io"><match url="^(.*)$" /><conditions><add input="{HTTP_HOST}" matchType="Pattern" pattern="^exceptionless.io$" /></conditions><action type="Redirect" url="https://be.{HTTP_HOST}/{R:1}" redirectType="SeeOther" /></rule><rule name="PushState" stopProcessing="true"><match url=".*" /><conditions logicalGrouping="MatchAll"><add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /><add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /><add input="{REQUEST_FILENAME}" pattern=".*[^.]*\.[\d\w]+$" negate="true" /><add input="{REQUEST_URI}" matchType="Pattern" pattern="api/(.*)" negate="true" /></conditions><action type="Rewrite" url="/" /></rule></rules></rewrite>-->
        </system.webServer>
        <location path="error.html">
          <system.web>
            <httpModules>
              <clear />
            </httpModules>
          </system.web>
          <system.webServer>
            <modules>
              <clear />
            </modules>
          </system.webServer>
        </location>
        <location path="exceptionless.png">
          <system.web>
            <httpModules>
              <clear />
            </httpModules>
          </system.web>
          <system.webServer>
            <modules>
              <clear />
            </modules>
          </system.webServer>
        </location>
        <location path="favicon.ico">
          <system.web>
            <httpModules>
              <clear />
            </httpModules>
          </system.web>
          <system.webServer>
            <modules>
              <clear />
            </modules>
          </system.webServer>
        </location>
        <location path="index.html">
          <system.web>
            <httpModules>
              <clear />
            </httpModules>
          </system.web>
          <system.webServer>
            <modules>
              <clear />
            </modules>
          </system.webServer>
        </location>
        <runtime>
          <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
            <dependentAssembly>
              <assemblyIdentity name="System.Web.Http" publicKeyToken="31bf3856ad364e35" culture="neutral" />
              <bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
            </dependentAssembly>
            <dependentAssembly>
              <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
              <bindingRedirect oldVersion="0.0.0.0-10.0.0.0" newVersion="10.0.0.0" />
            </dependentAssembly>
            <dependentAssembly>
              <assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad364e35" culture="neutral" />
              <bindingRedirect oldVersion="0.0.0.0-3.1.0.0" newVersion="3.1.0.0" />
            </dependentAssembly>
            <dependentAssembly>
              <assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" culture="neutral" />
              <bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
            </dependentAssembly>
            <dependentAssembly>
              <assemblyIdentity name="Microsoft.Owin.Security" publicKeyToken="31bf3856ad364e35" culture="neutral" />
              <bindingRedirect oldVersion="0.0.0.0-3.1.0.0" newVersion="3.1.0.0" />
            </dependentAssembly>
            <dependentAssembly>
              <assemblyIdentity name="System.Web.Cors" publicKeyToken="31bf3856ad364e35" culture="neutral" />
              <bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
            </dependentAssembly>
            <dependentAssembly>
              <assemblyIdentity name="Microsoft.AspNet.SignalR.Core" publicKeyToken="31bf3856ad364e35" culture="neutral" />
              <bindingRedirect oldVersion="0.0.0.0-2.2.0.0" newVersion="2.2.0.0" />
            </dependentAssembly>
            <dependentAssembly>
              <assemblyIdentity name="NLog" publicKeyToken="5120e14c03d0593c" culture="neutral" />
              <bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
            </dependentAssembly>
            <dependentAssembly>
              <assemblyIdentity name="SimpleInjector" publicKeyToken="984cb50dea722e99" culture="neutral" />
              <bindingRedirect oldVersion="0.0.0.0-3.1.1.0" newVersion="3.1.1.0" />
            </dependentAssembly>
            <dependentAssembly>
              <assemblyIdentity name="Microsoft.Owin.FileSystems" publicKeyToken="31bf3856ad364e35" culture="neutral" />
              <bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0" />
            </dependentAssembly>
            <dependentAssembly>
              <assemblyIdentity name="Microsoft.Data.Edm" publicKeyToken="31bf3856ad364e35" culture="neutral" />
              <bindingRedirect oldVersion="0.0.0.0-5.6.4.0" newVersion="5.6.4.0" />
            </dependentAssembly>
            <dependentAssembly>
              <assemblyIdentity name="Microsoft.Data.Services.Client" publicKeyToken="31bf3856ad364e35" culture="neutral" />
              <bindingRedirect oldVersion="0.0.0.0-5.6.4.0" newVersion="5.6.4.0" />
            </dependentAssembly>
            <dependentAssembly>
              <assemblyIdentity name="Microsoft.Data.OData" publicKeyToken="31bf3856ad364e35" culture="neutral" />
              <bindingRedirect oldVersion="0.0.0.0-5.6.4.0" newVersion="5.6.4.0" />
            </dependentAssembly>
            <dependentAssembly>
              <assemblyIdentity name="SimpleInjector.Extensions.ExecutionContextScoping" publicKeyToken="984cb50dea722e99" culture="neutral" />
              <bindingRedirect oldVersion="0.0.0.0-3.1.1.0" newVersion="3.1.1.0" />
            </dependentAssembly>
            <dependentAssembly>
              <assemblyIdentity name="System.Collections.Immutable" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
              <bindingRedirect oldVersion="0.0.0.0-1.2.1.0" newVersion="1.2.1.0" />
            </dependentAssembly>
          </assemblyBinding>
        </runtime>
        <location path="index.html">
          <system.webServer>
            <staticContent>
              <clientCache cacheControlMode="DisableCache" />
            </staticContent>
          </system.webServer>
        </location>
      </configuration>

        

  4. 如果你修改了Exceptionless的默认路由,记得改下app.config.77fc9ddd679d37dc.js文件中的地址。

  5. 然后启动elasticsearch、redis。再将exceptionless部署到iis即可。
  6. 打开http://localhost:50000,注册一个账号,然后登入:
  7.  

posted @ 2019-06-03 10:08  隔壁老黎  阅读(606)  评论(0编辑  收藏  举报