ILogger

Namespace: ASPSecurityKit
Assembly: ASPSecurityKit.dll

Summary

Provides a simple interface for writing application logs.

Methods

Error(ex)

Summary

Logs the specified exception as an error.

Parameters
Name Type Description
ex System.Exception The exception to log.
Exceptions
Type Description
System.ArgumentNullException When ex is null.

Error(ex,msg,args)

Summary

Logs the specified exception along with a custom message as an error.

Parameters
Name Type Description
ex System.Exception The exception.
msg System.String The custom message.
args System.Object[] Arguments to use while formatting custom message.
Exceptions
Type Description
System.ArgumentNullException When ex is null or msg is null/whitespace.

Warn(msg,args)

Summary

Logs the specified message as warning.

Parameters
Name Type Description
msg System.String The message to be logged.
args System.Object[] Arguments to use while formatting message.
Exceptions
Type Description
System.ArgumentNullException When msg is null/whitespace.

Info(msg,args)

Summary

Logs the specified message as an information.

Parameters
Name Type Description
msg System.String The message to be logged.
args System.Object[] Arguments to use while formatting message.
Exceptions
Type Description
System.ArgumentNullException When msg is null/whitespace.

ErrorAsync(ex)

Summary

Logs the specified exception as an error.

Parameters
Name Type Description
ex System.Exception The exception to log.
Exceptions
Type Description
System.ArgumentNullException When ex is null.

ErrorAsync(ex,cancellationToken)

Summary

Logs the specified exception as an error.

Parameters
Name Type Description
ex System.Exception The exception to log.
cancellationToken System.Threading.CancellationToken The cancellation token.
Exceptions
Type Description
System.ArgumentNullException When ex is null.

ErrorAsync(ex,msg,args)

Summary

Logs the specified exception along with a custom message as an error.

Parameters
Name Type Description
ex System.Exception The exception.
msg System.String The custom message.
args System.Object[] Arguments to use while formatting custom message.
Exceptions
Type Description
System.ArgumentNullException When ex is null or msg is null/whitespace.

ErrorAsync(ex,msg,cancellationToken,args)

Summary

Logs the specified exception along with a custom message as an error.

Parameters
Name Type Description
ex System.Exception The exception.
msg System.String The custom message.
cancellationToken System.Threading.CancellationToken The cancellation token.
args System.Object[] Arguments to use while formatting custom message.
Exceptions
Type Description
System.ArgumentNullException When ex is null or msg is null/whitespace.

WarnAsync(msg,args)

Summary

Logs the specified message as warning.

Parameters
Name Type Description
msg System.String The message to be logged.
args System.Object[] Arguments to use while formatting message.
Exceptions
Type Description
System.ArgumentNullException When msg is null/whitespace.

WarnAsync(msg,cancellationToken,args)

Summary

Logs the specified message as warning.

Parameters
Name Type Description
msg System.String The message to be logged.
cancellationToken System.Threading.CancellationToken The cancellation token.
args System.Object[] Arguments to use while formatting message.
Exceptions
Type Description
System.ArgumentNullException When msg is null/whitespace.

InfoAsync(msg,args)

Summary

Logs the specified message as an information.

Parameters
Name Type Description
msg System.String The message to be logged.
args System.Object[] Arguments to use while formatting message.
Exceptions
Type Description
System.ArgumentNullException When msg is null/whitespace.

InfoAsync(msg,cancellationToken,args)

Summary

Logs the specified message as an information.

Parameters
Name Type Description
msg System.String The message to be logged.
cancellationToken System.Threading.CancellationToken The cancellation token.
args System.Object[] Arguments to use while formatting message.
Exceptions
Type Description
System.ArgumentNullException When msg is null/whitespace.