PostSharp6.6//API Reference/Post­Sharp.​Patterns.​Diagnostics Namespace/Logger Class/Logger Methods/Logger.​Write­Exception Method/Logger.​Write­Exception(T1, T2) Method (Log­Level, Exception, String, T1, T2)

Logger.WriteException<T1, T2> Method (LogLevel, Exception, String, T1, T2)

Writes a custom log record with 2 parameters and associates it with an Exception.

Namespace:  PostSharp.Patterns.Diagnostics
Assembly:  PostSharp.Patterns.Common (in PostSharp.Patterns.Common.dll) Version: 6.6.14.0 (6.6.14.0)
Syntax
C#
public void WriteException<T1, T2>(
	LogLevel level,
	Exception exception,
	string formattingString,
	T1 arg1,
	T2 arg2
)

Parameters

level
Type: PostSharp.Patterns.Diagnostics.LogLevel
The severity of the record (e.g. Warning or Error).
exception
Type: System.Exception
The Exception associated with the record.
formattingString
Type: System.String
The text of the log record, including parameters (e.g. Opening {Path} file {ShareMode} sharing mode).
arg1
Type: T1
Value of the first parameter.
arg2
Type: T2
Value of the second parameter.

Type Parameters

T1
Type of the first parameter.
T2
Type of the second parameter.
See Also