Giter Site home page Giter Site logo

Comments (4)

mperdeck avatar mperdeck commented on July 2, 2024

I'm not quite sure what you're setting out to achieve. However, this is an open source project. Please have a look at the sources. You'll find it is a very simple. If you decide to make improvements that would have value for all users, I would be open to a pull request.

from common.logging.log4net.universal.

queston02 avatar queston02 commented on July 2, 2024

Just wanted to let you know that original Log4Net1213 have below mentioned piece of code through which custom properties set in ILog of common.logging were passed to log4net.
if (base.CustomProperties != null && base.CustomProperties.Count > 0) { foreach (KeyValuePair<string, object> customProperty in base.CustomProperties) { ThreadContext.get_Properties().set_Item(customProperty.Key, customProperty.Value); } }
This is missing in your Log4Net.Universal.

from common.logging.log4net.universal.

PokeyTheCat avatar PokeyTheCat commented on July 2, 2024

@queston02 I think I'm starting to understand what you're getting at. With this package you can't pass anything to the log4net.ThreadContext, is that snippet from your own code? Couldn't you just override and use the Log4NetThreadVariablesContext.

Copy Log4NetGlobalVariablsContext.cs, Log4NetThreadVariablesContext.cs,Log4NetNestedThreadVariablesContext.cs, etc over and then put following in the Log4NetLogger.cs:

/// <summary>
/// Returns the global context for variables
/// </summary>
public override IVariablesContext GlobalVariablesContext
{
	get { return new Log4NetGlobalVariablesContext(); }
}

/// <summary>
/// Returns the thread-specific context for variables
/// </summary>
public override IVariablesContext ThreadVariablesContext
{
	get { return new Log4NetThreadVariablesContext(); }
}

/// <summary>
/// 
/// </summary>
public override INestedVariablesContext NestedThreadVariablesContext
{
	get { return new Log4NetNestedThreadVariablesContext(); }
}

from common.logging.log4net.universal.

queston02 avatar queston02 commented on July 2, 2024

@PokeyTheCat that makes complete sense. Thanks for the suggestion. If things workout i might even put a pull request with changes.

from common.logging.log4net.universal.

Related Issues (7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.