I want to be able to catch this event in order to not only log the message but to insert this message into a ListView simultaneously. Is there such an event?
NLog 1.0 supports asynchronous logging, but there is no good support for asynchronous exception handling. This is because wrappers targets are not capable of receiving exceptions which are raised on other threads.
By default, the web. nlog file can be found at: C:\Program Files (x86)\Pleasant Solutions\Pleasant Password Server\www\web. nlog.
NLog supports semantic/structured logging known from similar frameworks like Serilog and Microsoft. Extensions. Logging. With structured logging, you no longer log just simple text messages.
NLog is “a free logging platform for . NET, Silverlight and Windows Phone with rich log routing and management capabilities. It makes it easy to produce and manage high-quality logs for your application regardless of its size or complexity.”
The comments are right, but to elaborate:
In NLog log-events aren't event-driven (there are no event handlers), but route-driven. So every event is matched to the defined routes (the <rules>
in your nlog.config).
With the routes you can send the log-events so 0, 1 or multiple targets and create fallbacks, filtering etc.
So if you need the logevents in a ListView, you need to search for a target to use or write a custom one.
Full list of targets are here: https://nlog-project.org/config/?tab=targets
Writing a custom target is explained here: https://github.com/NLog/NLog/wiki/How-to-write-a-custom-target
Happy logging :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With