ToolStripItemTarget Class |
Namespace: NLog.Windows.Forms
The ToolStripItemTarget type exposes the following members.
| Name | Description | |
|---|---|---|
| ToolStripItemTarget |
Initializes a new instance of the ToolStripItemTarget class.
|
| Name | Description | |
|---|---|---|
| FormName |
Gets or sets the name of the Form on which the ToolStrip is located.
| |
| ItemName |
Gets or sets the name of the ToolStripItem to which NLog will log write log text.
| |
| Layout |
Gets or sets the layout used to format log messages.
(Inherited from TargetWithLayout.) | |
| Name |
Gets or sets the name of the target.
(Inherited from Target.) | |
| ToolStripName |
Gets or sets the name of ToolStrip that contains the ToolStripItem to which NLog will log write log text.
|
| Name | Description | |
|---|---|---|
| Dispose |
Closes the target.
(Inherited from Target.) | |
| Flush |
Flush any pending log messages (in case of asynchronous targets).
(Inherited from Target.) | |
| PrecalculateVolatileLayouts |
Calls the Precalculate(LogEventInfo) on each volatile layout
used by this target.
This method won't prerender if all layouts in this target are thread-agnostic.
(Inherited from Target.) | |
| ToString | Returns a string that represents the current object. (Inherited from Target.) | |
| WriteAsyncLogEvent |
Writes the log to the target.
(Inherited from Target.) | |
| WriteAsyncLogEvents(AsyncLogEventInfo) |
Writes the array of log events.
(Inherited from Target.) | |
| WriteAsyncLogEvents(IListAsyncLogEventInfo) |
Writes the array of log events.
(Inherited from Target.) |
To set up the target in the configuration file, use the following syntax:
1!ERROR: See log file!The result is:

To set up the log target programmatically similar to above use code like this:
1!ERROR: See log file!