手失败。
清除Url
我们现在使用的Url都会带有#!
,例如
http://localhost:50001/#!/type/error/dashboard
可以按照下面步骤清除字符#!
- 首先保证你的IIS是否已经安装了重写模块,可通过双击IIS中的
模块
查看是否包含了RewriteModule
- 更新
Web.config
文件
- 释放出在
system.webServer
中的rewrite
节点
- 删除
BaseURL
值中的/#
- 注释了在
system.webServer\modules
中的<remove name="RewriteModule" />
标签
- 修改
app.config.77fc9ddd679d37dc.js
文件中USE_HTML5_MODE
的值为true
进程外运行作业
默认情况下,所有作业都在当前的Web进程中运行。如果发现事件处理开始变慢的时候,可以启动并扩展多个作业实例。通过在进程外运行作业,可以确保所有作业是否正常运行。
- 首先是要配置安装Redis,这样可以保证Exceptionless与作业之间能够进行通信
- 更新
Web.config
中的RunJobsInProcess
值为false
- 更新作业的配置,有两种方法可选:
- 使用环境变量进行配置Exceptionless。新增环境变量Exceptionless_{SETTING NAME} (例如: Exceptionless_BaseURL, Exceptionless_ElasticSearchConnectionString)。这是官方推荐的方法,因为它更简单,而且当部署到azure时非常好用
- 打开App_Data\jobs文件夹,然后按照在根目录中
Web.config
的配置,再重新配置每个作业的xxx.exe.config
。
- 在每个作业文件夹中都有一个
run.bat
文件,双击它就会运行这个作业。当然,也可以将这些作业全部设置为Windows服务在后台运行
更多设置
除了上面提到的设置,Exceptionless还支持很多自定义配置,下面是全部的设置列表,大家可根据自己的需要进行定制
列表按照这个格式进行排列:设置项 (数据类型,默认值)
EnableSSL (bool)
BaseURL (string)
InternalProjectId (string, "54b56e480ef9605a88a13153")
WebsiteMode (WebsiteMode, "Dev")
AppScope (string, String.Empty)
TestEmailAddress (string)
AllowedOutboundAddresses (List<string>, "exceptionless.io")
RunJobsInProcess (bool, true)
BotThrottleLimit (int, 25)
ApiThrottleLimit (int, Int32.MaxValue)
EventSubmissionDisabled (bool)
MaximumEventPostSize (long, 1000000)
MaximumRetentionDays (int, 180)
EnableDailySummary (bool)
MetricsServerName (string, "127.0.0.1")
MetricsServerPort (int, 8125)
EnableMetricsReporting (bool)
RedisConnectionString (string)
EnableRedis (bool)
DisableSnapshotJobs (bool)
DisableIndexConfiguration (bool)
ElasticSearchConnectionString (string)
ElasticSearchNumberOfShards (int, 1)
ElasticSearchNumberOfReplicas (int)
EnableElasticsearchTracing (bool)
LdapConnectionString (string)
EnableActiveDirectoryAuth (bool)
EnableSignalR (bool, true)
Version (string)
EnableIntercom (bool)
IntercomAppSecret (string)
EnableAccountCreation (bool, true)
MicrosoftAppId (string)
MicrosoftAppSecret (string)
FacebookAppId (string)
FacebookAppSecret (string)
GitHubAppId (string)
GitHubAppSecret (string)
GoogleAppId (string)
GoogleAppSecret (string)
GoogleGeocodingApiKey (string)
EnableBilling (bool)
StripeApiKey (string)
StorageFolder (string)
AzureStorageConnectionString (string)
EnableAzureStorage (bool)
BulkBatchSize (int, 1000)
SmtpHost (string)
SmtpPort (int, 587)
SmtpEnableSsl (bool, true)
SmtpUser (string)
SmtpPassword (string)
更多日志类型
Exceptionless除了支持记录Exception,也可以记录LogMessage、Broken Links 、Feature Usages
LogMessage
LogMessage支持多种级别的日志信息
- Other
- Trace
- Debug
- Info
- Warn
- Error
- Fatal
- Off
用法也很简单,直接在你想要记录日志的地方直接加一句
ExceptionlessClient.Default.CreateLog("日志信息", LogLevel.Debug).AddTags("tag1", "tag2").Submit();
所以我们在应用的过程中,可以添加一个统一的接口
public interface ILogger
{
void Debug(string message, params string[] tags);
void Error(string message, params string[] tags);
void Fatal(string message, params string[] tags);
void Info(string message, params string[] tags);
void Off(string message, params string[] tags);
void Other(string message, p