configuration - How to add target of NLog to a specific textbox control, so the log messages will be shown in that control -


I used the following configuration of NLog to add log text to the control of the name specified on the specified form.

  & lt; Nlog xmlns = "http://www.nlog-project.org/schemas/NLog.xsd" xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance" & gt; & Lt; Goal & gt; & Lt; Target name = "control" xsi: type = "form control" append = "true" control name = "text box 1" formname = "form1" /> & Lt; / Targets & gt; & Lt; Rules & gt; & Lt; Logger name = "*" minlevel = "debug" instrument = "control" /> & Lt; / Rules & gt; & Lt; / Nlog & gt;  

My name is a form with Form 1 and simultaneously control name text box 1. However, the NLog crashes a new form in runtime and adds a docked text box to it and shows the logs in it.

How can I create a log for my form and control?

Problem found:

The names used in config are case-sensitive.

should be text box 1 TextBox1


Comments