Show Menu
Cheatography

MCLog Usage Guidelines Cheat Sheet by

MCLog Usage Guidelines

Message Severity

-1
NONE
Do not use, system use only
0
CRIT
Something has gone wrong and immediate attention is required
1
ERR
Something has gone wrong and should be addressed, but does not require immediate attention
2
WARN
Something unexpected happened, but is not necess­arily a bug
3
INFO
Progress output or general inform­ation. INFO logging and a properly configured LogToC­onsole listener may be used in place of Consol­e.W­rit­eLine()
4
DEBUG
Debug inform­ation, info dumps, etc.
5
DEBUG2
Debug inform­ation, info dumps, etc.
6
DEBUG3
Debug inform­ation, info dumps, etc.
10
REPORTING
Reporting and perfor­mance logging

Format Tokens

{attr1} - {attr8}
Attributes 1 through 8
{error­class}
Error Class
{error­sub­class}
Error Subclass
{app}
The Applic­ation Name
{assem­bly­ver­sion}
The Assembly Version
{machi­nename}
Machine Name
{proce­ssid}
Process ID
{threadid}
Thread ID
{msgid}
Message ID
{severity}
Severity
{source}
Source
{tag}
Tag (from Config)
{event­time}
Event Date
{day}
Event Date - Day
{month}
Event Date - Month
{year}
Event Date - Year
{hour}
Event Date - Hour
{minute}
Event Date - Minute
{second}
Event Date - Second
{message}
Message Body

Severity Filter

EnumValue
Integer repres­enting any valid message severity
("2" = WARN)
EnumVa­lue­Range
Inclusive range of message severities
("0-2" = CRIT, ERR, & WARN)
EnumName
String repres­enting a severity enum name
("Crit" = CRIT)
Comma separated list of expres­sions (EnumV­alues, EnumVa­lue­Ranges, and/or EnumNames) repres­enting the message severities to be processed by a log listener ("1-3, Debug, 10" = ERR, WARN, INFO, DEBUG, & REPORTING)

MCLog.L­og­ToC­onsole

Severi­tyF­ilter
CRIT, ERR
Filter describing severities to log
Format
{message}
Format to use for output
{Supports format tokens}

MCLog.L­og­ToDB2

SeverityFilter
CRIT, ERR
Filter describing severities to log
Connec­tio­nString
 
Name of connection string to use
MaxAge
MaxValue
TimeSpan indicating how long to retain logging
MaxDays
 
Number of days to retain logging
(overr­idden by MaxAge)
CleanupProbability
Denominator
1000
Probab­ility of triggering cleanup
(Proba­bility = 1/Deno­min­ator)
 

MCLog.L­og­ToEmail

SeverityFilter
CRIT, ERR
Filter describing which severities to log
MailServer
 
SMTP server address
Port
25
SMTP server port
From
 
Email message from address
To
 
Comma delimited list of email message recipient addresses
Subject
 
Email message subject
{Supports format tokens}
Body
{message}
...
Email message body
{Supports format tokens}

MCLog.L­og­ToE­ventLog

SeverityFilter
CRIT, ERR
Filter describing severities to log
EventLogSource
Applic­ation Error
Source string to use in event log message
Format
{message}
...
Format to use for output
{Supports format tokens}

MCLog.L­og­ToFile

SeverityFilter
CRIT, ERR
Filter describing severities to log
BasePath
 
Absolute log file path
(combined with FilePath)
FilePath
 
Relative log file path and file name
{Supports format tokens}
Format
Event...
Format to use for output
{Supports format tokens}
MaxRetries
3
Number of retries when writing to file fails
RetryDelay
250ms
TimeSpan indicating pause between retries when writing to file fails
Delimiter
-----...
Delimiter separating messages in file
MaxAge
MaxValue
TimeSpan indicating how long to retain logging
MaxDays
 
Number of days to retain logging
(Overr­idden by MaxAge)
CleanupProbability
Denominator
1000
Probab­ility of triggering cleanup
(Proba­bility = 1/Deno­min­ator)

MCLog.L­og­ToF­unction

SeverityFilter
CRIT, ERR
Filter describing severities to log
Format
{message}
Format to use for output
{Supports format tokens}

MCLog.L­og­ToS­tring

SeverityFilter
CRIT, ERR
Filter describing severities to log
Format
{message}.
Format to use for output
{Supports format tokens}

MCLog.U­se­rMe­ssages

SeverityFilter
CRIT, ERR
Filter describing severities to log
Format
{message}
Format to use for output
{Supports format tokens}
MaxQueueSize
100
Max number of user messages to queue for retrieval
           
 

Comments

No comments yet. Add yours below!

Add a Comment

Your Comment

Please enter your name.

    Please enter your email address

      Please enter your Comment.

          Related Cheat Sheets

          System Design Cheat Sheet
          AWS Services by Nir Elbaz
          Devo LINQ, query language syntax Cheat Sheet