Giter Site home page Giter Site logo

Comments (6)

welcome avatar welcome commented on July 21, 2024

Hi! Thanks for opening your first issue here! Please make sure to follow the issue template - so we could help you better!

from nlog.windows.forms.

snakefoot avatar snakefoot commented on July 21, 2024

Thank you for the feedback. If you can figure out where it issue is in the RichTextBoxTarget-source-code:

Then we can look at improving the source-code.

from nlog.windows.forms.

snakefoot avatar snakefoot commented on July 21, 2024

You are also wellcome to enable the NLog InternalLogger and then post the output, and highlight where the unexpected behavior occurs.

This might help guesing where in the source-code the issue is.

from nlog.windows.forms.

dwanboweb avatar dwanboweb commented on July 21, 2024

The problem seems to be in RichTextBoxTarget.DetachFromControl, which will set TargetRichTextBox to null. When setting NLog.LogManager.Configuration to a new value, the setter will call config.close, which will invoke Target.Close() and then RichTextBoxTarget.DetachFromControl(). This will make TargetRichTextBox of RichTextBoxTarget null, and it will also affect the new value of Configuration when the new value is itself.
var config = NLog.LogManager.Configuration; // do some thing to config NLog.LogManager.Configuration = config; // in the setter of Configuration, TargetRichTextBox of RichTextBoxTarget will be null, and the new value is itself, so it will also affect the new value of Configuration

from nlog.windows.forms.

snakefoot avatar snakefoot commented on July 21, 2024

Notice that you are allowed to add new LoggingRules to the active LogManager.Configuration, without doing reassign NLog.LogManager.Configuration = NLog.LogManager.Configuration;

The trick is calling NLog.LogManager.ReconfigExistingLoggers() after having done the changes, to commit/activate them.

from nlog.windows.forms.

snakefoot avatar snakefoot commented on July 21, 2024

Closing issue as resolved, due to inactivity

from nlog.windows.forms.

Related Issues (20)

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.