Configuration 如何将NLog的目标添加到特定的文本框控件,以便在该控件中显示日志消息
我使用NLog的以下配置将日志文本添加到指定表单上指定名称的控件中Configuration 如何将NLog的目标添加到特定的文本框控件,以便在该控件中显示日志消息,configuration,winforms,nlog,Configuration,Winforms,Nlog,我使用NLog的以下配置将日志文本添加到指定表单上指定名称的控件中 <nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <targets> <target name="control" xsi:type="FormControl" append="true"
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<targets>
<target name="control" xsi:type="FormControl" append="true"
controlName="textBox1" formName="Form1"/>
</targets>
<rules>
<logger name="*" minlevel="Debug" writeTo="control"/>
</rules>
</nlog>
我有一个名为Form1的表单,它上的控件名为textBox1。
nLog仍然在运行时创建一个新表单,并向其添加一个停靠的文本框,并显示其中的日志
现在,如何将日志写入我的窗体和我的控件,这是一个问题:
配置中使用的名称区分大小写
textBox1
应该是textBox1