-
Notifications
You must be signed in to change notification settings - Fork 0
ColoredConsole target
Writes log messages to the console with customizable coloring.
Supported in .NET and Mono ##Configuration Syntax
<targets>
<target xsi:type="ColoredConsole"
name="String"
layout="Layout"
header="Layout"
footer="Layout"
useDefaultRowHighlightingRules="Boolean"
errorStream="Boolean">
<highlight-row backgroundColor="Enum" condition="Condition" foregroundColor="Enum"/><!-- repeated -->
<highlight-word backgroundColor="Enum" foregroundColor="Enum" ignoreCase="Boolean"
regex="String" text="String" wholeWords="Boolean"/><!-- repeated -->
</target>
</targets>
Read more about using the [Configuration File](Configuration file).
##Parameters
###General Options
name - Name of the target.
###Layout Options
layout - Text to be rendered. Layout Required. Default: ${longdate}|${level:uppercase=true}|${logger}|${message}
header - Header. Layout
footer - Footer. Layout
###Highlighting Rules
useDefaultRowHighlightingRules - Indicates whether to use default row highlighting rules. [Boolean](Data types) Default: True
The default rules are:
| Condition | Foreground Color | Background Color |
|---|---|---|
condition - Condition that must be met in order to set the specified foreground and background color. [Condition](Data types) Required.
foregroundColor - Foreground color. Default: NoChange
Possible values:
- Black - Black Color (#000000).
- Blue - Blue Color (#0000FF).
- Cyan - Cyan Color (#00FFFF).
- DarkBlue - Dark blue Color (#000080).
- DarkCyan - Dark Cyan Color (#008080).
- DarkGray - Dark Gray Color (#808080).
- DarkGreen - Dark green Color (#008000).
- DarkMagenta - Dark Magenta Color (#800080).
- DarkRed - Dark Red Color (#800000).
- DarkYellow - Dark Yellow Color (#808000).
- Gray - Gray Color (#C0C0C0).
- Green - Green Color (#00FF00).
- Magenta - Magenta Color (#FF00FF).
- NoChange - Don't change the color.
- Red - Red Color (#FF0000).
- White - White Color (#FFFFFF).
- Yellow - Yellow Color (#FFFF00).
wordHighlightingRules - The word highlighting rules. [Collection](Data types)
Each collection item is represented by <highlight-word /> element with the following attributes:
-
backgroundColor - Background color. Default: NoChange
Possible values:- Black - Black Color (#000000).
- Blue - Blue Color (#0000FF).
- Cyan - Cyan Color (#00FFFF).
- DarkBlue - Dark blue Color (#000080).
- DarkCyan - Dark Cyan Color (#008080).
- DarkGray - Dark Gray Color (#808080).
- DarkGreen - Dark green Color (#008000).
- DarkMagenta - Dark Magenta Color (#800080).
- DarkRed - Dark Red Color (#800000).
- DarkYellow - Dark Yellow Color (#808000).
- Gray - Gray Color (#C0C0C0).
- Green - Green Color (#00FF00).
- Magenta - Magenta Color (#FF00FF).
- NoChange - Don't change the color.
- Red - Red Color (#FF0000).
- White - White Color (#FFFFFF).
- Yellow - Yellow Color (#FFFF00).
foregroundColor - Foreground color. Default: NoChange
Possible values:
- Black - Black Color (#000000).
- Blue - Blue Color (#0000FF).
- Cyan - Cyan Color (#00FFFF).
- DarkBlue - Dark blue Color (#000080).
- DarkCyan - Dark Cyan Color (#008080).
- DarkGray - Dark Gray Color (#808080).
- DarkGreen - Dark green Color (#008000).
- DarkMagenta - Dark Magenta Color (#800080).
- DarkRed - Dark Red Color (#800000).
- DarkYellow - Dark Yellow Color (#808000).
- Gray - Gray Color (#C0C0C0).
- Green - Green Color (#00FF00).
- Magenta - Magenta Color (#FF00FF).
- NoChange - Don't change the color.
- Red - Red Color (#FF0000).
- White - White Color (#FFFFFF).
- Yellow - Yellow Color (#FFFF00).
ignoreCase - Indicates whether to ignore case when comparing texts. [Boolean](Data types) Default: False
regex - Regular expression to be matched. You must specify either text or regex.
text - Text to be matched. You must specify either text or regex.
wholeWords - Indicates whether to match whole words only. [Boolean](Data types) Default: False
###Output Options errorStream - Indicates whether the error stream (stderr) should be used instead of the output stream (stdout). [Boolean](Data types) Default: False