StreamLink.NET
ConsoleLogger Class
StreamLink.NETCaplin.StreamLink.LoggingConsoleLogger
An implementation of ILogger that simply logs exceptions and other log messages to the console.
Declaration Syntax
C#Visual BasicVisual C++
public class ConsoleLogger : IExceptionHandler, 
	ILogger
Public Class ConsoleLogger _
	Implements IExceptionHandler, ILogger
public ref class ConsoleLogger : IExceptionHandler, 
	ILogger
Members
All MembersConstructorsMethodsProperties



IconMemberDescription
ConsoleLogger()()()
Initializes a new instance of the ConsoleLogger class that logs messages of all levels (severities) and categories.

ConsoleLogger(array<String>[]()[])
Initializes a new instance of the ConsoleLogger class that only logs messages in the categories specified by logCategoryFilter.

Equals(Object)
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Finalize()()()
Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
(Inherited from Object.)
GetHashCode()()()
Serves as a hash function for a particular type. GetHashCode()()() is suitable for use in hashing algorithms and data structures like a hash table.
(Inherited from Object.)
GetType()()()
Gets the Type of the current instance.
(Inherited from Object.)
HandleException(Exception)
Logs a StreamLink .NET exception. This method is automatically called by StreamLink once the ConsoleLogger has been registered with the StreamLink instance as an exception handler.

Level
The lowest level (severity) that messages are logged at. For example, if Level is set to SourceLevels.Information then only messages at Information level and above will be logged (that is, messages at levels Information, Warning, Error, Critical). The default value is SourceLevels.All, which causes messages at all levels to be logged.

Log(SourceLevels, String, String)
Logs a single message with a given severity and category.

Log(SourceLevels, String, String, array<String>[]()[])
Logs a single message with supplied parameter values substituted into it.

Log(SourceLevels, array<String>[]()[], String)
Logs a single message with a given severity and one or more categories.

Log(SourceLevels, array<String>[]()[], String, array<String>[]()[])
Logs a single message with a given severity and one or more categories, and with supplied parameter values substituted into it.

MemberwiseClone()()()
Creates a shallow copy of the current Object.
(Inherited from Object.)
ToString()()()
Returns a String that represents the current Object.
(Inherited from Object.)
Remarks

This simple implementation of ILogger is provided for use when developing StreamLink enabled applications, and you should not normally use it in deployed applications. In applications for deployment you are recommended to use a fully featured logging framework, such as Apache log4net.

The ConsoleLogger must be registered with StreamLink so that StreamLink .NET exceptions will automatically be logged through calls to HandleException(Exception), and StreamLink .NET errors and other activity will automatically be logged through calls to the various Log(SourceLevels, String, String) methods. Register by setting both the ExceptionHandler and Logger properties of the StreamLink object to the instance of ConsoleLogger,

For information on how to use the inbuilt FileLogger instead of ConsoleLogger, see FileLoggerConfiguration.

Inheritance Hierarchy
Object
ConsoleLogger

Assembly: Caplin.StreamLink (Module: Caplin.StreamLink) Version: 5.0.8.0 (5.0.8.0)