https://github.com/net-commons/common-logging
A portable logging abstraction for .NET
https://github.com/net-commons/common-logging
Last synced: about 1 month ago
JSON representation
A portable logging abstraction for .NET
- Host: GitHub
- URL: https://github.com/net-commons/common-logging
- Owner: net-commons
- License: apache-2.0
- Created: 2011-07-31T23:10:24.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2021-09-23T16:10:03.000Z (over 3 years ago)
- Last Synced: 2024-08-01T02:27:14.784Z (9 months ago)
- Language: C#
- Homepage: http://net-commons.github.io/common-logging
- Size: 35.8 MB
- Stars: 648
- Watchers: 73
- Forks: 205
- Open Issues: 61
-
Metadata Files:
- Readme: readme.md
- Changelog: changelog.txt
- License: license.txt
Awesome Lists containing this project
- awesome-dotnet-core - common-logging - Portable logging abstraction for .NET. (Frameworks, Libraries and Tools / Logging)
- awesome-dotnet-core - common-logging - 抽象的日志记录库。 (框架, 库和工具 / 日志)
- fucking-awesome-dotnet-core - common-logging - Portable logging abstraction for .NET. (Frameworks, Libraries and Tools / Logging)
- awesome-dotnet-core - common-logging - Portable logging abstraction for .NET. (Frameworks, Libraries and Tools / Logging)
README
# Common.Logging .NET
## Project Build Status
[](https://ci.appveyor.com/project/sbohlen/common-logging/branch/master)*Note: Build may periodically fail due to issues with the code-coverage tooling (NCover) being unable to reliably connect to the test-runner during test-runs on the CI server platform we've selected (Appveyor). Work continues to investigate this further, but until resolved properly visitors are advised to discount failing builds reported here.
## Introduction
Provides a simple logging abstraction to switch between different logging implementations.
There is current support for log4net, NLog, Microsoft Enterprise Library logging, Microsoft Application Insights, Microsoft Event Tracing for Windows, and Serilog.Additionally Common.Logging comes with a set of base classes making the integration of any log system a breeze.
See also
* [Github Repo](http://github.com/net-commons/common-logging)
* [Project Website](http://net-commons.github.io/common-logging)
* [NuGet](https://www.nuget.org/packages/Common.Logging/): `Install-Package Common.Logging`## Console Quickstart
This demonstrates how to configure your app to log using the built in Common.Logging console adapter.### 1) Install Common.Logging via NuGet
Either open the Package Management Console and enter the following or use the built-in GUINuGet: `PM> Install-Package Common.Logging`
### 2) Register and configure Common.Logging
Then add the relevant sections to your `app.config` or `web.config`:```xml
```
## NLog Quickstart
There are different packages for each major NLog version. Install the correct package for your referenced NLog version. This example installs the adapter for NLog v4.1:PM> Install-Package Common.Logging.NLog41
If you are using NLog v4.0, you should install the `Common.Logging.NLog40` package and so on.
NB: Because NLog is using semver and the same strong name for every major version, Common.Logging.NLog40 and Common.Logging.NLog41 works for all NLog 4.x version. Common.Logging.NLog41 is the recommend version
The app config should then have a common logging section like below. Be sure to match the `factoryAdapter type` with your installed `Common.Logging.NLogXX` version.
```xml
...
```
## Application Insights Quickstart
There are different packages for each major Application Insights version. Install the correct package for your referenced Application Insights version. This example installs the adapter for Application Insights v0.17:PM> Install-Package Microsoft.ApplicationInsights -Version 0.17.0
The app config should then have an Application Insights section like below. Be sure to set the InstrumentationKey with your InstrumentationKey retrieved from Application Insights portal https://portal.azure.com.
```xml
```
See module documentation and [Source Forge](http://netcommon.sf.net/) for other factoryAdapters and their configuration values
## Solution Layout
* **bin** contains the Common.Logging distribution dll files
* **doc** contains reference documentation.
* **shared** contains shared nant build scripts
* **modules** contains the sourcecode for Common.Logging.XXXX modules
* **redist** contains redistributable assemblies like log4net for your convenienceThe Common Infrastructure Libraries for .NET are released under the terms of the Apache Software License (see [license.txt](license.txt)).
## Building
* Clone the [GitHub repository](https://github.com/net-commons/common-logging)
* Install Silverlight SDK 5
* [Optional] Install Java for the documentation builder
* Create a strong name key. `c:\netcommon>sn -k common.net.snk`
* Build the the solution. `c:\netcommon>build-release.cmd`