Common.Logging (2024)

Welcome to Common.Logging!

Common.Logging provides a basic logging abstraction for developers to code against that makes it easy to switch your application from one logging framework to the next via simple configuration. Common.Logging offers multiple ready-built adapters to support the most popular logging frameworks in the .NET ecosystem today.

If your logging framework of choice isn't already supported, Common.Logging also provides a set of ready-to-use base classes that make it very low-friction to extend Common.Logging support to just about any logging framework you might need.

License

Common.Logging is licensed under the terms of the Apache License, Version 2.0. The full text of this license is available for review in plain text or HTML.

Support for most popular logging Frameworks

Common.Logging provides adapters that support all of the following popular logging targets/frameworks in .NET:

  • Log4Net (v1.2.9 - v1.2.15)
  • NLog (v1.0 - v4.4.1)
  • SeriLog (v1.5.14)
  • Microsoft Enterprise Library Logging Application Block (v3.1 - v6.0)
  • Microsoft AppInsights (2.4.0)
  • Microsoft Event Tracing for Windows (ETW) [overview]
  • Log to STDOUT
  • Log to DEBUG OUT

Support for most popular .NET Runtime Environments

Common.Logging offers Logging abstractions to support you regardless of the .NET run-time environment you're targeting. Common.Logging supports all of the following popular .NET run-times:
  • .NET 2.0
  • .NET 3.0
  • .NET 3.5
  • .NET 4.0
  • .NET 4.5
  • Silverlight 5.0
  • Windows Phone 7.x
  • Windows Phone 8.x
  • WinRT 8.1 (for Windows 8.1 and Windows Phone 8.1)
  • Universal Windows Platform 10.0+ (WinRT for Windows 10)
  • .NET Core 1.0

Getting Started with Common.Logging

Using Common.Logging in your own Project

The Common.Logging binaries are available via the NuGet package management system.

As seen from the lists above, Common.Logging offers support for a very wide variety of both logging frameworks and .NET run-times. To support this variety, Common.Logging has adopted a highly-modular NuGet packaging strategy. This means that developers need only consume the packages from Common.Logging specifically for their desired combination of .NET run-time, logging framework type, and logging framework version.

Before selecting which Common.Logging package(s) to add to your project, developers are encouraged to visit the Common.Logging Wiki and familiarize themselves with the packaging strategy for Common.Logging explained there.

Contributing to Common.Logging

The Common.Logging project is hosted on GitHub; follow the link at the top of this page to visit the source repository, report any issues, and join in the community!

Common.Logging (2024)

FAQs

What is common logging? ›

Common. Logging provides a basic logging abstraction for developers to code against that makes it easy to switch your application from one logging framework to the next via simple configuration. Common. Logging offers multiple ready-built adapters to support the most popular logging frameworks in the .

What are Commons Logging properties? ›

The commons-logging.properties file is used to specify the WebCenter Sites logging system via the org.apache.commons.logging.Log property. Newly installed WebCenter Sites systems use Apache log4j, which is specified as follows: org.apache.commons.logging.Log=com.fatwire.cs.core.logging.Log4JLogger.

What is the difference between SLF4J and Commons Logging? ›

SLF4J is conceptually very similar to Apache Commons Logging a.k.a. Jakarta Commons Logging (JCL). As such, it can be thought of as yet another logging facade. However, SLF4J is much simpler in design and arguably more robust. In a nutshell, SLF4J avoid the class loader issues that plague JCL.

What is common logging in spring? ›

Spring Boot uses Commons Logging for all internal logging but leaves the underlying log implementation open. Default configurations are provided for Java Util Logging, Log4J2, and Logback. In each case, loggers are pre-configured to use console output with optional file output also available.

What is the most common type of logging? ›

Clear-Cutting Logging

One of the most common methods of logging is clear-cutting, which involves the removal of all the trees in a specific area. Afterward, workers plant seeds, so new trees can grow.

Does commons logging use Log4J? ›

logging. Log is not set, Commons Logging will use Apache Log4J if it is available in the classpath. To explicitly configure Commons Logging to use Log4J, set the org. apache.

What are the two types of logging? ›

Logging is generally categorized into two categories: selective and clear-cutting. Selective logging is selective because loggers choose only wood that is highly valued, such as mahogany. Clear-cutting is not selective.

Why use SLF4J instead of Log4j? ›

SLF4J provides placeholder based logging, which improves the readability of code by removing checks like isInforEnabled(), isDebugEnabled(), etc. By using the logging method of SLF4J, we defer the cost of constructing logging messages (string), until you need it, which is both CPU and memory efficient.

Why should we use SLF4J? ›

This is the main purpose of SLF4J (Simple Logging Facade for Java) – a logging abstraction which helps to decouple your application from the underlying logger by allowing it to be plugged in – at runtime. Of course, the flexibility that such an abstraction provides is the main reason to use SLF4J.

Should I use Log4j or Log4j2? ›

Log4j2 comes with many features that Log4j didn't have. Similarly, Log4j only supported configuration files in properties and XML formats, while Log4j2 supports configuration through XML, JSON, YAML, and configuration files/programmatic actions. In comparison to Log4j, Log4j2 has active community support.

What is the best type of logging? ›

Clear-cutting allows logging many trees at once, which saves operation time, so it is good for time-management reasons. However, selective logging is still better than completely or mostly empty areas after clear-cuts because it leaves some wood to harvest for the nearest years.

What is JCL over SLF4J? ›

JCL-over-SLF4J, i.e. jcl-over-slf4j. jar, comes in handy in situations where JCL needs to be supported for backward compatibility reasons. It can be used to fix problems associated with JCL, without necessarily adopting the SLF4J API, a decision which can be deferred to a later time.

Does Spring Boot use Log4J or logback? ›

Spring Boot uses the Logback library for logging by default. In this section, we'll learn about a couple of extensions to Logback that can help with advanced configuration. It's also worth mentioning that Spring Boot recommends using logback-spring. xml for Logback instead of the default logback.

What are common logs and what do they measure? ›

A common log is a logarithm with base 10, i.e., log10 = log. A natural log is a logarithm with base e, i.e., loge = ln. Logarithms are used to do the most difficult calculations of multiplication and division.

What is logging in simple words? ›

logging, process of harvesting trees, sawing them into appropriate lengths (bucking), and transporting them (skidding) to a sawmill.

What is the common log format? ›

The NCSA Common Log Format (CLF) is one of the oldest log formats used by web servers. It's a standardized, text-based log file with a fixed format, which means you can't customize the fields. Each line in the log file includes: Remote host address.

Top Articles
Latest Posts
Article information

Author: Mrs. Angelic Larkin

Last Updated:

Views: 5859

Rating: 4.7 / 5 (47 voted)

Reviews: 86% of readers found this page helpful

Author information

Name: Mrs. Angelic Larkin

Birthday: 1992-06-28

Address: Apt. 413 8275 Mueller Overpass, South Magnolia, IA 99527-6023

Phone: +6824704719725

Job: District Real-Estate Facilitator

Hobby: Letterboxing, Vacation, Poi, Homebrewing, Mountain biking, Slacklining, Cabaret

Introduction: My name is Mrs. Angelic Larkin, I am a cute, charming, funny, determined, inexpensive, joyous, cheerful person who loves writing and wants to share my knowledge and understanding with you.