Update README
This commit is contained in:
Родитель
86df78df41
Коммит
2f1fcb66da
|
@ -133,3 +133,11 @@ tc.channel.sender.send_time = 5
|
|||
# the background worker thread will poll the queue every 0.5 seconds for new items
|
||||
tc.channel.sender.send_interval = 0.5
|
||||
```
|
||||
|
||||
###Collecting unhandled exceptions###
|
||||
```ruby
|
||||
require 'application_insights'
|
||||
# setup unhandled exception handler
|
||||
ApplicationInsights::UnhandledException.collect('<YOUR INSTRUMENTATION KEY GOES HERE>')
|
||||
# raise an exception and this would be send to Application Insights Service
|
||||
raise Exception, 'Boom!'
|
||||
|
|
|
@ -17,7 +17,8 @@ module ApplicationInsights
|
|||
# raise Exception, 'Boom!'
|
||||
def self.collect(instrumentation_key)
|
||||
at_exit do
|
||||
send(instrumentation_key)
|
||||
# Avoid sending exception more than once if this method got invoked multiple times
|
||||
send(instrumentation_key) if !@sender
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче