Joutsen Logging v0.5.0+26-g72240ac
Loading...
Searching...
No Matches
Public Member Functions | Properties | List of all members
Joutsen.Logging.Configuration.LoggerConfig Class Reference

A configuration element for the logger. More...

Public Member Functions

 LoggerConfig (string type, FilterConfig filter, String name=null)
 Creates a new configuration object configured by code.
 
 LoggerConfig (IConfigurationSection section)
 Creates a new configuration object from the json configuration section.
 
Logger CreateLogger ()
 Creates a logger from the configuraton.
 

Properties

string Type [get]
 The configured type of logger as a class name.
 
string Name [get]
 The name of the logger that can be used to access it.
 
FilterConfig Filter [get]
 The configuration for the filter of the logger.
 
HandlerConfig[] Handlers [get, set]
 The configuration for the handlers of the logger.
 

Detailed Description

A configuration element for the logger.

Since
0.5.0

Constructor & Destructor Documentation

◆ LoggerConfig() [1/2]

Joutsen.Logging.Configuration.LoggerConfig.LoggerConfig ( string  type,
FilterConfig  filter,
String  name = null 
)

Creates a new configuration object configured by code.

Parameters
typethe configured type of logger as a class name
filterthe configuration for the filter of the logger
Exceptions
ArgumentNullExceptionif no filter is provided
ArgumentExceptionif the type is missing or only whitespaces

◆ LoggerConfig() [2/2]

Joutsen.Logging.Configuration.LoggerConfig.LoggerConfig ( IConfigurationSection  section)

Creates a new configuration object from the json configuration section.

Parameters
sectionthe configuration section containing the values for the handler
Exceptions
ConfigurationErrorsExceptionif no or an invalid type or filter are configured
Remarks
The configuration section needs to provide all mandatory values for the handler.

Member Function Documentation

◆ CreateLogger()

Logger Joutsen.Logging.Configuration.LoggerConfig.CreateLogger ( )

Creates a logger from the configuraton.

Property Documentation

◆ Filter

FilterConfig Joutsen.Logging.Configuration.LoggerConfig.Filter
get

The configuration for the filter of the logger.

◆ Handlers

HandlerConfig [] Joutsen.Logging.Configuration.LoggerConfig.Handlers
getset

The configuration for the handlers of the logger.

◆ Name

string Joutsen.Logging.Configuration.LoggerConfig.Name
get

The name of the logger that can be used to access it.

◆ Type

string Joutsen.Logging.Configuration.LoggerConfig.Type
get

The configured type of logger as a class name.