Comments (6)
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.
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.
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.
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.
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.
Closing issue as resolved, due to inactivity
from nlog.windows.forms.
Related Issues (20)
- net6.0-windows
- Support Layoutable properties HOT 3
- Fix default layout comments
- Breaking changes version 5
- Change AssemblyVersion to 5.0.0.0
- Using Only NLog.config for RichTextBox Does Not Log HOT 3
- Add net6.0-windows since LTS
- Continuous Build not running on merge to master HOT 1
- NullReferenceException in RichTextBoxTarget SendTheMessageToRichTextBox
- Question: Is it possible to write to winforms ListView? HOT 2
- Form hanging when RichTextBox target nonstop logging HOT 6
- Symbols package publishing failed. HOT 1
- System.NullReferenceException calling ReInitializeAllTextboxes() HOT 5
- Missing source package on NuGet HOT 4
- RichTextBoxTarget - An exception occurred under NET48 HOT 3
- Create a nuget package with net5.0-windows platform supporting HOT 3
- No RowColor for RichTextBoxTarget when LeftToRight.Yes set HOT 3
- When to support net6.0 platform? HOT 2
- PublishSingleFile causes Target symbol-name is unknown: 'RichTextBox' HOT 16
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nlog.windows.forms.