Class LambdaSharpAppClient
The Lambda
Inheritance
Implements
Namespace: LambdaSharp.App
Assembly: LambdaSharp.App.dll
Syntax
public sealed class LambdaSharpAppClient : ILambdaSharpLogger, IAsyncDisposable
Constructors
LambdaSharpAppClient(LambdaSharpAppConfig, HttpClient)
Initializes a new Lambda
Declaration
public LambdaSharpAppClient(LambdaSharpAppConfig config, HttpClient httpClient)
Parameters
Type | Name | Description |
---|---|---|
Lambda |
config | A Lambda |
System. |
httpClient | A |
Properties
DebugLoggingEnabled
The Debug
Declaration
public bool DebugLoggingEnabled { get; }
Property Value
Type | Description |
---|---|
System. |
Boolean indicating if requests and responses are logged |
ErrorReportGenerator
Retrieve the Error
Declaration
public ILambdaErrorReportGenerator ErrorReportGenerator { get; }
Property Value
Type | Description |
---|---|
ILambda |
The Error |
Info
The Info property return information about the LambdaSharp environment.
Declaration
public ILambdaSharpInfo Info { get; }
Property Value
Type | Description |
---|---|
ILambda |
The ILambda |
Methods
Log(LambdaLogLevel, Exception, String, Object[])
Log a message with the given severity level. The format
string is used to create a unique signature for errors.
Therefore, any error information that varies between occurrences should be provided in the arguments
parameter.
Declaration
public void Log(LambdaLogLevel level, Exception exception, string format, params object[] arguments)
Parameters
Type | Name | Description |
---|---|---|
Lambda |
level | The severity level of the log message. See Lambda |
System. |
exception | Optional exception to log. The exception is logged with its description and stacktrace. This parameter can be |
System. |
format | Optional message to use instead of |
System. |
arguments | Optional arguments for the |
Remarks
Nothing is logged if both format
and exception
are null.
Log(LogLevel, Boolean, Exception, String, Object[])
Log a message with the given severity level. The format
string is used to create a unique signature for errors.
Therefore, any error information that varies between occurrences should be provided in the arguments
parameter.
Declaration
public void Log(LogLevel logLevel, bool echo, Exception exception, string format, params object[] arguments)
Parameters
Type | Name | Description |
---|---|---|
Microsoft. |
logLevel | The severity level of the log message. See Microsoft. |
System. |
echo | Echo log message to the browser console. |
System. |
exception | Optional exception to log. The exception is logged with its description and stacktrace. This parameter can be |
System. |
format | Optional message to use instead of |
System. |
arguments | Optional arguments for the |
Remarks
Nothing is logged if both format
and exception
are null.
LogEvent<T>(T, IEnumerable<String>)
Send a CloudWatch event with optional event details and resources it applies to. This event is forwarded to the configured EventBridge. The 'detail-type' property is set to the full type name of the detail value.
Declaration
public void LogEvent<T>(T detail, IEnumerable<string> resources = null)
Parameters
Type | Name | Description |
---|---|---|
T | detail | Data-structure to serialize as a JSON string. If value is already a |
System. |
resources | Optional AWS or custom resources, identified by unique identifier (e.g. ARN), which the event primarily concerns. Any number, including zero, may be present. |
Type Parameters
Name | Description |
---|---|
T |
LogException(Exception)
The Log
Declaration
public void LogException(Exception exception)
Parameters
Type | Name | Description |
---|---|---|
System. |
exception | Exception to record. |
LogRecord(ALambdaLogRecord)
Log a ALambda
Declaration
public void LogRecord(ALambdaLogRecord record)
Parameters
Type | Name | Description |
---|---|---|
ALambda |
record | The record to log. |