Sentry.Log4Net 0.0.1-preview3

Official log4net integration for Sentry - Open-source error tracking that helps developers monitor and fix crashes in real time.

This is a prerelease version of Sentry.Log4Net.
There is a newer version of this package available.
See the version list below for details.
Install-Package Sentry.Log4Net -Version 0.0.1-preview3
dotnet add package Sentry.Log4Net --version 0.0.1-preview3
<PackageReference Include="Sentry.Log4Net" Version="0.0.1-preview3" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Sentry.Log4Net --version 0.0.1-preview3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Configuration

Once the log4net integration package is installed on your project, you can modify your configuration file to add the appender.
This can be done, for example, via the app.config or web.config in case of ASP.NET.

  <appender name="SentryAppender" type="Sentry.Log4Net.SentryAppender, Sentry.Log4Net">
      <Dsn value="dsn"/>
      <!--Sends the log event Identity value as the user-->
      <SendIdentity value="true" />
      <threshold value="INFO" />
    </appender>

For how it's done in this sample, please refer to sample app.config.

The example above defines the DSN so that the SentryAppender is able to initialize the SDK.

This is only one of the options. If you wish to configure the SDK manually in the app before creating the logging integration, you could leave the DSN out of the log4net configuration file and call:

SentrySdk.Init("DSN");

One of the advantages of this approach is that you can pass multiple configurations via the Init method.

Bottom line is that the SDK needs to be initialized only once so you can choose where the initialization will happen. Other integrations (like ASP.NET) also is able to initialize the SDK. Make sure you pass the DSN to only one of these integrations, or if you are calling Init by yourself, there's no need to pass the DSN to the integration.

Please refer to the sample to see it in action.

Sample event in Sentry

Configuration

Once the log4net integration package is installed on your project, you can modify your configuration file to add the appender.
This can be done, for example, via the app.config or web.config in case of ASP.NET.

  <appender name="SentryAppender" type="Sentry.Log4Net.SentryAppender, Sentry.Log4Net">
      <Dsn value="dsn"/>
      <!--Sends the log event Identity value as the user-->
      <SendIdentity value="true" />
      <threshold value="INFO" />
    </appender>

For how it's done in this sample, please refer to sample app.config.

The example above defines the DSN so that the SentryAppender is able to initialize the SDK.

This is only one of the options. If you wish to configure the SDK manually in the app before creating the logging integration, you could leave the DSN out of the log4net configuration file and call:

SentrySdk.Init("DSN");

One of the advantages of this approach is that you can pass multiple configurations via the Init method.

Bottom line is that the SDK needs to be initialized only once so you can choose where the initialization will happen. Other integrations (like ASP.NET) also is able to initialize the SDK. Make sure you pass the DSN to only one of these integrations, or if you are calling Init by yourself, there's no need to pass the DSN to the integration.

Please refer to the sample to see it in action.

Sample event in Sentry

Release Notes

Can be found at: https://github.com/getsentry/sentry-dotnet/releases

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
3.0.0-alpha.2 34 10/21/2020
3.0.0-alpha.1 47 10/16/2020
3.0.0-alpha.0 78 9/25/2020
2.2.0-alpha 160 9/19/2020
2.1.6 2,033 8/20/2020
2.1.5 4,812 7/27/2020
2.1.5-beta 153 6/30/2020
2.1.4 3,737 6/25/2020
2.1.3 1,451 6/5/2020
2.1.2-beta5 104 5/19/2020
2.1.2-beta4 78 5/12/2020
2.1.2-beta3 80 5/7/2020
2.1.2-beta2 1,356 4/16/2020
2.1.2-beta 344 3/31/2020
2.1.1 12,332 3/19/2020
2.1.0 3,926 2/24/2020
2.0.3 1,162 2/12/2020
2.0.2 272 2/8/2020
2.0.1 584 1/28/2020
2.0.0 203 1/28/2020
2.0.0-beta8 147 1/15/2020
2.0.0-beta7 162 12/17/2019
2.0.0-beta6 343 10/31/2019
2.0.0-beta5 119 10/29/2019
2.0.0-beta4 3,373 9/4/2019
2.0.0-beta3 141 7/26/2019
2.0.0-beta2 180 6/9/2019
2.0.0-beta 175 6/4/2019
1.2.1-beta 164 5/27/2019
1.2.0 28,600 5/23/2019
1.1.3-beta4 169 5/15/2019
1.1.3-beta3 161 5/13/2019
1.1.3-beta2 180 3/28/2019
1.1.3-beta 206 2/11/2019
1.1.2 7,900 1/16/2019
1.1.2-beta 202 1/8/2019
1.1.1 416 1/5/2019
1.1.0 1,031 12/5/2018
1.0.1-beta5 192 12/5/2018
1.0.1-beta4 213 12/3/2018
1.0.1-beta3 1,328 11/15/2018
1.0.1-beta2 327 11/14/2018
1.0.1-beta 240 10/24/2018
1.0.0 2,044 10/2/2018
1.0.0-rc2 237 9/7/2018
1.0.0-rc 225 8/24/2018
0.0.1-preview5 344 8/5/2018
0.0.1-preview4 281 7/30/2018
0.0.1-preview3 299 7/21/2018
Show less