Writes log messages to the console.
Platforms Supported: All
There is also the colorful ColoredConsole-Target that can highlight single words or color entire rows.
<targets> <target xsi:type="Console" name="String" layout="Layout" footer="Layout" header="Layout" encoding="Encoding" stderr="Boolean" detectConsoleAvailable="Boolean" writeBuffer="Boolean" /> </targets>
Read more about using the Configuration File.
${longdate}|${level:uppercase=true}|${logger}|${message:withexception=true}
encoding - File encoding name like "utf-8", "ascii" or "utf-16". See Encoding class on MSDN. Defaults to Encoding.Default
.
Introduced in NLog 4.0.
StdErr - Indicates whether the error stream (stderr) should be used instead of the output stream (stdout). Layout Default: false
Before NLog v5.0 the property was named
error
. Before NLog v6.0 the property was boolean instead of NLog Layout
detectConsoleAvailable - Indicates whether the console target should disable itself when no console detected. Boolean Default: false
Introduced in NLog 4.3.10 with default:
true
, then NLog 4.4 changed default tofalse
.
autoFlush - Performs explicit flush after every console write. Useful if having redirected to custom console-stream that doesn't has autoflush enabled. Boolean. Default = False.
Introduced in NLog 4.6.3
ForceWriteLine - Call Console.WriteLine
instead of writing directly to buffer using Console.Write
. Available if doing console-redirection that requires Console.WriteLine
. Default: False
.
Before NLog v6.0 the property was named
WriteBuffer
which was introduced with v4.6.8.
<target name="Console" xsi:type="Console" layout="${longdate} ${logger} ${level} ${message}"/>
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4