-
Notifications
You must be signed in to change notification settings - Fork 5
Release/0.8.0 #74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
StrangeWill
wants to merge
27
commits into
master
Choose a base branch
from
release/0.8.0
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Release/0.8.0 #74
Changes from 21 commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
6e3d3d3
Open 0.7.1
StrangeWill 895373a
Remove this.
StrangeWill 1811545
New project structure
StrangeWill 50d8da9
Update dependencies
StrangeWill c47eaeb
Remove unsupported .NET Core 1.x, add 3.x
StrangeWill 6862518
Add message formatter to SendException
StrangeWill 02ccd68
Add message to exception
StrangeWill d09744c
Some test clean-up
StrangeWill 11608ad
Fix tests with new messages
StrangeWill 2126152
Fix null ref
StrangeWill 2b06111
Cleanup and moving exception message to title
StrangeWill 789ee21
Details on disabling and using loggger factory
StrangeWill ca8ed3d
Make tests match new parameter names
StrangeWill 84695e8
Clean up markdown warnings
StrangeWill 8d2243a
Only send exceptions once
StrangeWill 4884466
Add failing test case
ECrownofFire b94f0dc
Merge pull request #73 from ECrownofFire/master
StrangeWill ba52722
Upgrade packages, drop .net std 1.5 support
StrangeWill ce9f968
Fix singleton issue
StrangeWill f8237cf
Fix changelog replace issue
StrangeWill 22647cc
Move tests
StrangeWill f5e4032
Update lib license
StrangeWill 1e19d8b
Update copyright
StrangeWill 72f28ed
Move other items to singletons
StrangeWill 937ff9e
Replace non-concurrent dict with ConcurrentCache
ECrownofFire 02253a3
Merge pull request #75 from RoushTech/fix/response-cache
StrangeWill 00e7f6d
Use HttpClientFactory to prevent sockets hanging around
StrangeWill File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,37 @@ | ||
| .idea/ | ||
| src/RollbarDotNet/obj/ | ||
| src/RollbarDotNet/bin/ | ||
| .vs/ | ||
| *.lock.json | ||
| test/RollbarDotNet.Tests/bin/ | ||
| test/RollbarDotNet.Tests/obj/ | ||
| *.user | ||
| *.swp | ||
| *.*~ | ||
| project.lock.json | ||
| .DS_Store | ||
| *.pyc | ||
| nupkg/ | ||
|
|
||
| # Visual Studio Code | ||
| .vscode | ||
|
|
||
| # Rider | ||
| .idea | ||
|
|
||
| # User-specific files | ||
| *.suo | ||
| *.user | ||
| *.userosscache | ||
| *.sln.docstates | ||
|
|
||
| # Build results | ||
| [Dd]ebug/ | ||
| [Dd]ebugPublic/ | ||
| [Rr]elease/ | ||
| [Rr]eleases/ | ||
| x64/ | ||
| x86/ | ||
| build/ | ||
| bld/ | ||
| [Bb]in/ | ||
| [Oo]bj/ | ||
| [Oo]ut/ | ||
| msbuild.log | ||
| msbuild.err | ||
| msbuild.wrn | ||
|
|
||
| # Visual Studio 2015 | ||
| .vs/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,28 +1,28 @@ | ||
| # RollbarDotNet | ||
| []() | ||
|
|
||
| []() | ||
| []() | ||
| [](https://codeclimate.com/github/RoushTech/RollbarDotNet/maintainability) | ||
|
|
||
| Rollbar support for your .NET Core projects, relies on dependency injection and hooks up to your ASP.NET Core pipeline for easy use. | ||
|
|
||
| Inspired by RollbarSharp, great library, just required too many tweaks to make play with .NET core well in my opinion. | ||
|
|
||
| # Testing | ||
| ## Testing | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. First header should be a top level header |
||
|
|
||
| Environment variables for testing: | ||
|
|
||
| - ROLLBAR_TOKEN - Rollbar token for testing. | ||
|
|
||
| # Required services | ||
| ## Required services | ||
|
|
||
| Please make sure the following services are available for the various builder modules. | ||
|
|
||
| ``` csharp | ||
| app.UseRollbarExceptionHandler(); | ||
| ``` | ||
|
|
||
| # Using in ASP.NET Core | ||
| ## Using in ASP.NET Core | ||
|
|
||
| Place the following after your error handling code in Startup.Configure: | ||
|
|
||
|
|
@@ -42,7 +42,7 @@ There is also one that doesn't load the builders for building out environment in | |
| services.AddRollbar(Configuration); | ||
| ``` | ||
|
|
||
| Hook up the rollar configuration using the following code: | ||
| Hook up the Rollbar configuration using the following code: | ||
|
|
||
| ``` csharp | ||
| services.AddOptions(); // Most apps already are using this, but just in case. | ||
|
|
@@ -54,11 +54,20 @@ Configure Rollbar from your appSettings.json file like so: | |
| ``` javascript | ||
| "Rollbar": { | ||
| "AccessToken": "[access token here]", | ||
| "Environment": "[named environment here]" | ||
| "Environment": "[named environment here]", | ||
| "Disabled": false | ||
| } | ||
| ``` | ||
|
|
||
| ## Getting Occurrence UUIDs | ||
| If you want to use the ILogger implementation add this: | ||
|
|
||
| ``` csharp | ||
| loggerFactory.AddRollbarDotNetLogger(app.ApplicationServices); | ||
| ``` | ||
|
|
||
| In your `Configure()` method inside of `Startup.cs` | ||
|
|
||
| ## Getting Occurrence UUID | ||
|
|
||
| Getting the occurrence UUID is easy, just get it from the HttpContext Feature collection: | ||
|
|
||
|
|
@@ -70,27 +79,27 @@ public IActionResult Error() | |
| } | ||
| ``` | ||
|
|
||
| The UUID can be looked up directly via https://rollbar.com/occurrence/uuid/?uuid=[UUID HERE]. This may be really useful if you want to let your users report errors to you, you can include this UUID automatically in the report. | ||
| The UUID can be looked up directly via `https://rollbar.com/occurrence/uuid/?uuid=[UUID HERE]`. This may be really useful if you want to let your users report errors to you, you can include this UUID automatically in the report. | ||
|
|
||
| You can check if Rollbar has reported the exception via the IRollbarResponseFeature.Handled boolean. | ||
|
|
||
| # Calling Directly | ||
| ## Calling Directly | ||
|
|
||
| You can also post messages/exceptions directly if you so wish. | ||
|
|
||
| ``` csharp | ||
| // Send an exception | ||
| var response = await this.Rollbar.SendException(exception); | ||
| var response = await Rollbar.SendException(exception); | ||
| response.Uuid //Event UUID that can be looked up on the rollbar site. | ||
|
|
||
|
|
||
| // Send a message | ||
| var response = await this.Rollbar.SendMessage("Hello World!", RollbarLevels.Message); | ||
| var response = await Rollbar.SendMessage("Hello World!", RollbarLevels.Message); | ||
| ``` | ||
|
|
||
| # Calling Without Dependency Injection | ||
| ## Calling Without Dependency Injection | ||
|
|
||
| Although I *highly recommend* using depdency injection, you can fairly easily configure Rollbar by hand: | ||
| Although I *highly recommend* using dependency injection, you can fairly easily configure Rollbar by hand: | ||
|
|
||
| ``` csharp | ||
| var rollbarOptions = Options.Create(new RollbarOptions | ||
|
|
@@ -120,7 +129,7 @@ catch(Exception exception) | |
| } | ||
| ``` | ||
|
|
||
| # Blacklists | ||
| ## Blacklists | ||
|
|
||
| Blacklisting will replace variables with asterisks ("**********") when data is sent to Rollbar. | ||
|
|
||
|
|
@@ -141,23 +150,10 @@ Inside of your appSettings.json you have two options, using plaintext or regular | |
| } | ||
| ``` | ||
|
|
||
| Additional Blacklists can be coded by inheriting from the RollbarDotNet.Blacklisters.IBlacklister interface and registering it with your application's dependency injection framework. | ||
|
|
||
| Additional Blacklists can be coded by inheriting from the `RollbarDotNet.Blacklisters.IBlacklister` interface and registering it with your application's dependency injection framework. | ||
|
|
||
| ## To do | ||
|
|
||
| ### Implement stack frames | ||
|
|
||
| As of writing this .NET Core does not support walking the stack frames of the exception, means our error messages are pretty weak. | ||
|
|
||
| ### Log4net support | ||
|
|
||
| As far as I know log4net is _currently_ implementing .NET Core support. | ||
|
|
||
| ### Break out into separate libraries | ||
|
|
||
| .NET Core is all about keeping things slim, do we put ASPNETCore code in a different lib? | ||
|
|
||
| ### .NET 4.5.1 support | ||
|
|
||
| Would be nice for this to support .NET 4.5.1, no testing and no real effort outside of some basic preprocessor stuff in place. | ||
| .NET Core is all about keeping things slim, do we put ASP.NET code in a different lib? | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First header should be a top level header