Sac*_*van 6 configuration nlog winforms
我使用了以下 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"
controlName="textBox1" formName="Form1"/>
</targets>
<rules>
<logger name="*" minlevel="Debug" writeTo="control"/>
</rules>
</nlog>
Run Code Online (Sandbox Code Playgroud)
我有一个名为 Form1 的表单,并对其进行了名为 textBox1 的控件。nLog仍然在运行时创建一个新表单,并向其添加一个停靠文本框并在其中显示日志。
现在如何使 nLogwrite 将日志写入我的表单和我的控件