Skip to content
Open
Show file tree
Hide file tree
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 Nov 21, 2019
895373a
Remove this.
StrangeWill Nov 21, 2019
1811545
New project structure
StrangeWill Nov 21, 2019
50d8da9
Update dependencies
StrangeWill Nov 22, 2019
c47eaeb
Remove unsupported .NET Core 1.x, add 3.x
StrangeWill Nov 22, 2019
6862518
Add message formatter to SendException
StrangeWill Nov 22, 2019
02ccd68
Add message to exception
StrangeWill Nov 22, 2019
d09744c
Some test clean-up
StrangeWill Nov 22, 2019
11608ad
Fix tests with new messages
StrangeWill Nov 30, 2019
2126152
Fix null ref
StrangeWill Nov 30, 2019
2b06111
Cleanup and moving exception message to title
StrangeWill Nov 30, 2019
789ee21
Details on disabling and using loggger factory
StrangeWill Nov 30, 2019
ca8ed3d
Make tests match new parameter names
StrangeWill Nov 30, 2019
84695e8
Clean up markdown warnings
StrangeWill Nov 30, 2019
8d2243a
Only send exceptions once
StrangeWill Nov 30, 2019
4884466
Add failing test case
ECrownofFire Feb 1, 2020
b94f0dc
Merge pull request #73 from ECrownofFire/master
StrangeWill Mar 25, 2020
ba52722
Upgrade packages, drop .net std 1.5 support
StrangeWill Mar 25, 2020
ce9f968
Fix singleton issue
StrangeWill Mar 25, 2020
f8237cf
Fix changelog replace issue
StrangeWill Mar 25, 2020
22647cc
Move tests
StrangeWill Mar 25, 2020
f5e4032
Update lib license
StrangeWill Mar 25, 2020
1e19d8b
Update copyright
StrangeWill Mar 25, 2020
72f28ed
Move other items to singletons
StrangeWill May 5, 2020
937ff9e
Replace non-concurrent dict with ConcurrentCache
ECrownofFire Oct 30, 2023
02253a3
Merge pull request #75 from RoushTech/fix/response-cache
StrangeWill Oct 30, 2023
00e7f6d
Use HttpClientFactory to prevent sockets hanging around
StrangeWill Nov 23, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 37 additions & 8 deletions .gitignore
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/
18 changes: 9 additions & 9 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{
// Use IntelliSense to find out which attributes exist for C# debugging
// Use hover for the description of the existing attributes
// For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
"version": "0.2.0",
"configurations": [
// Use IntelliSense to find out which attributes exist for C# debugging
// Use hover for the description of the existing attributes
// For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
"version": "0.2.0",
"configurations": [
{
"name": ".NET Core Launch (console)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
// If you have changed target frameworks, make sure to update the program path.
"program": "${workspaceFolder}/test/RollbarDotNet.Tests/bin/Debug/netcoreapp1.0/RollbarDotNet.Tests.dll",
"program": "${workspaceFolder}/RollbarDotNet.Tests/bin/Debug/netcoreapp3.1/RollbarDotNet.Tests.dll",
"args": [],
"cwd": "${workspaceFolder}/test/RollbarDotNet.Tests",
"cwd": "${workspaceFolder}/RollbarDotNet.Tests",
// For more information about the 'console' field, see https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md#console-terminal-window
"console": "internalConsole",
"stopAtEntry": false,
Expand All @@ -23,6 +23,6 @@
"type": "coreclr",
"request": "attach",
"processId": "${command:pickProcess}"
}
,]
},
]
}
2 changes: 1 addition & 1 deletion .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"type": "process",
"args": [
"build",
"${workspaceFolder}/test/RollbarDotNet.Tests/RollbarDotNet.Tests.csproj"
"${workspaceFolder}/RollbarDotNet.Tests/RollbarDotNet.Tests.csproj"
],
"problemMatcher": "$msCompile"
}
Expand Down
66 changes: 39 additions & 27 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,71 +1,83 @@
# 0.7.0
# Releases

## 0.8.0

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


<sup>Released: 2020/03/25</sup>

- Dropped .NET Standard 1.5 support
- Upgraded to .NET Standard 2.1
- Change scope of RollbarClient to singleton.

## 0.7.0

<sup>Released: 2018/120/08</sup>

- Added ILogger support.

# 0.6.4
## 0.6.4

<sup>Released: 2017/10/22</sup>

- Fix a null reference exception when no declaring type on thrown exception.

# 0.6.3
## 0.6.3

<sup>Released: 2017/09/04</sup>

- Use per-request dependencies for handling RollbarClient to prevent errors.

# 0.6.2
## 0.6.2

<sup>Released: 2017/8/20</sup>

- Change method trace string to have full namespace, method name and parameters.

# 0.6.1
## 0.6.1

<sup>Released: 2017/8/20</sup>

- Fixed a bug where .NET Core Service extensions were excluded from the library.

# 0.6.0
## 0.6.0

<sup>Released: 2017/8/20</sup>

## Features
### Features

- Upgrade to VS2017/CSProj.
- Add trace frame support.
- Also target NetStandard2.0

# 0.5.2
## 0.5.2

<sup>Released: 2017/4/21</sup>

## Features
### Features

- Updated documentation. #49
- Can now disable Rollbar from configuration. #48
- Updated documentation. ##49
- Can now disable Rollbar from configuration. ##48

## Bug Fixes
### Bug Fixes

- Fix issue with trying to access Request.Form variables during POSTs that may not actually support form variables. #54
- Fix issue with trying to access Request.Form variables during POSTs that may not actually support form variables. ##54

# 0.5.1
## 0.5.1

<sup>Released: 2017/3/10</sup>

## Features
### Features

- More robust testing of sending exceptions to Rollbar (see readme.md for instructions on configuring token for testing).

## Bug Fixes
### Bug Fixes

- Fixed issue sending Rollbar exceptions.

# 0.5.0
## 0.5.0

<sup>Released: 2017/2/26</sup>

## Features
### Features

- IHttpContextAccessor is no longer assumed to be included as part of `AddIdentity()`, we'll add it.
- Testing of dependency injection for web platforms (console apps coming soon).
Expand All @@ -74,43 +86,43 @@
- Person record support (thank you mkdabrowski).
- Exception builder is now injectable.

## Bug Fixes
### Bug Fixes

- Sending a message to Rollbar no longer results in a null reference exception being thrown.

# 0.4.0
## 0.4.0

<sup>Released: 2016/9/30</sup>

## Features
### Features

- Upgrade for .NET Core 1.0 release.

# 0.3.0
## 0.3.0

<sup>Released: 2016/6/12</sup>

## Features
### Features

- Added support for cookies on request body.
- Added blacklisting variables by name.

# 0.2.0
## 0.2.0

<sup>Released: 2016/6/9</sup>

## Features
### Features

- Rollbar message UUID available after error is reported.
- Removed custom parameters from message body.
- Documentation for required configuration variables.

# 0.1.0
## 0.1.0

<sup>Released: 2016/5/31</sup>

Initial release.

## Features
### Features

- Ability to send basic logs to Rollbar
54 changes: 25 additions & 29 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
# RollbarDotNet
[![NuGet](https://img.shields.io/nuget/v/RollbarDotNet.svg)]()

[![NuGet](https://img.shields.io/nuget/v/RollbarDotNet.svg)]()
[![Build](https://img.shields.io/teamcity/https/teamcity.roushtech.net/s/RollbarDotNet_Build.svg)]()
[![Maintainability](https://api.codeclimate.com/v1/badges/0b51030e89b49ab252f3/maintainability)](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

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


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:

Expand All @@ -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.
Expand All @@ -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:

Expand All @@ -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
Expand Down Expand Up @@ -120,7 +129,7 @@ catch(Exception exception)
}
```

# Blacklists
## Blacklists

Blacklisting will replace variables with asterisks ("**********") when data is sent to Rollbar.

Expand All @@ -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?
Loading