LoggerMessage.Define Method

Definition

Overloads

Define(LogLevel, EventId, String)

Creates a delegate that can be invoked for logging a message.

Define(LogLevel, EventId, String, LogDefineOptions)

Creates a delegate that can be invoked for logging a message.

Define<T1,T2,T3,T4,T5,T6>(LogLevel, EventId, String, LogDefineOptions)

Creates a delegate that can be invoked for logging a message.

Define<T1,T2,T3,T4,T5,T6>(LogLevel, EventId, String)

Creates a delegate that can be invoked for logging a message.

Define<T1,T2,T3,T4,T5>(LogLevel, EventId, String, LogDefineOptions)

Creates a delegate that can be invoked for logging a message.

Define<T1,T2,T3,T4,T5>(LogLevel, EventId, String)

Creates a delegate that can be invoked for logging a message.

Define<T1,T2,T3,T4>(LogLevel, EventId, String)

Creates a delegate that can be invoked for logging a message.

Define<T1,T2,T3,T4>(LogLevel, EventId, String, LogDefineOptions)

Creates a delegate that can be invoked for logging a message.

Define<T1,T2,T3>(LogLevel, EventId, String)

Creates a delegate that can be invoked for logging a message.

Define<T1,T2,T3>(LogLevel, EventId, String, LogDefineOptions)

Creates a delegate that can be invoked for logging a message.

Define<T1,T2>(LogLevel, EventId, String)

Creates a delegate that can be invoked for logging a message.

Define<T1,T2>(LogLevel, EventId, String, LogDefineOptions)

Creates a delegate that can be invoked for logging a message.

Define<T1>(LogLevel, EventId, String, LogDefineOptions)

Creates a delegate that can be invoked for logging a message.

Define<T1>(LogLevel, EventId, String)

Creates a delegate that can be invoked for logging a message.

Define(LogLevel, EventId, String)

Source:
LoggerMessage.cs
Source:
LoggerMessage.cs
Source:
LoggerMessage.cs

Creates a delegate that can be invoked for logging a message.

public static Action<Microsoft.Extensions.Logging.ILogger,Exception?> Define (Microsoft.Extensions.Logging.LogLevel logLevel, Microsoft.Extensions.Logging.EventId eventId, string formatString);

Parameters

logLevel
LogLevel

The LogLevel.

eventId
EventId

The event ID.

formatString
String

The named format string.

Returns

A delegate that, when invoked, creates a log message.

Applies to

.NET 9 (package-provided) e outras versões
Produto Versões
.NET 8 (package-provided), 9 (package-provided)
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)
.NET Standard 2.0 (package-provided)

Define(LogLevel, EventId, String, LogDefineOptions)

Source:
LoggerMessage.cs
Source:
LoggerMessage.cs
Source:
LoggerMessage.cs

Creates a delegate that can be invoked for logging a message.

public static Action<Microsoft.Extensions.Logging.ILogger,Exception?> Define (Microsoft.Extensions.Logging.LogLevel logLevel, Microsoft.Extensions.Logging.EventId eventId, string formatString, Microsoft.Extensions.Logging.LogDefineOptions? options);

Parameters

logLevel
LogLevel

The LogLevel.

eventId
EventId

The event ID.

formatString
String

The named format string.

Returns

A delegate that, when invoked, creates a log message.

Applies to

.NET 9 (package-provided) e outras versões
Produto Versões
.NET 8 (package-provided), 9 (package-provided)
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)
.NET Standard 2.0 (package-provided)

Define<T1,T2,T3,T4,T5,T6>(LogLevel, EventId, String, LogDefineOptions)

Source:
LoggerMessage.cs
Source:
LoggerMessage.cs
Source:
LoggerMessage.cs

Creates a delegate that can be invoked for logging a message.

public static Action<Microsoft.Extensions.Logging.ILogger,T1,T2,T3,T4,T5,T6,Exception?> Define<T1,T2,T3,T4,T5,T6> (Microsoft.Extensions.Logging.LogLevel logLevel, Microsoft.Extensions.Logging.EventId eventId, string formatString, Microsoft.Extensions.Logging.LogDefineOptions? options);

Type Parameters

T1

The type of the first parameter passed to the named format string.

T2

The type of the second parameter passed to the named format string.

T3

The type of the third parameter passed to the named format string.

T4

The type of the fourth parameter passed to the named format string.

T5

The type of the fifth parameter passed to the named format string.

T6

The type of the sixth parameter passed to the named format string.

Parameters

logLevel
LogLevel

The LogLevel.

eventId
EventId

The event ID.

formatString
String

The named format string.

Returns

Action<ILogger,T1,T2,T3,T4,T5,T6,Exception>

A delegate that, when invoked, creates a log message.

Applies to

.NET 9 (package-provided) e outras versões
Produto Versões
.NET 8 (package-provided), 9 (package-provided)
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)
.NET Standard 2.0 (package-provided)

Define<T1,T2,T3,T4,T5,T6>(LogLevel, EventId, String)

Source:
LoggerMessage.cs
Source:
LoggerMessage.cs
Source:
LoggerMessage.cs

Creates a delegate that can be invoked for logging a message.

public static Action<Microsoft.Extensions.Logging.ILogger,T1,T2,T3,T4,T5,T6,Exception?> Define<T1,T2,T3,T4,T5,T6> (Microsoft.Extensions.Logging.LogLevel logLevel, Microsoft.Extensions.Logging.EventId eventId, string formatString);

Type Parameters

T1

The type of the first parameter passed to the named format string.

T2

The type of the second parameter passed to the named format string.

T3

The type of the third parameter passed to the named format string.

T4

The type of the fourth parameter passed to the named format string.

T5

The type of the fifth parameter passed to the named format string.

T6

The type of the sixth parameter passed to the named format string.

Parameters

logLevel
LogLevel

The LogLevel.

eventId
EventId

The event ID.

formatString
String

The named format string.

Returns

Action<ILogger,T1,T2,T3,T4,T5,T6,Exception>

A delegate that, when invoked, creates a log message.

Applies to

.NET 9 (package-provided) e outras versões
Produto Versões
.NET 8 (package-provided), 9 (package-provided)
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)
.NET Standard 2.0 (package-provided)

Define<T1,T2,T3,T4,T5>(LogLevel, EventId, String, LogDefineOptions)

Source:
LoggerMessage.cs
Source:
LoggerMessage.cs
Source:
LoggerMessage.cs

Creates a delegate that can be invoked for logging a message.

public static Action<Microsoft.Extensions.Logging.ILogger,T1,T2,T3,T4,T5,Exception?> Define<T1,T2,T3,T4,T5> (Microsoft.Extensions.Logging.LogLevel logLevel, Microsoft.Extensions.Logging.EventId eventId, string formatString, Microsoft.Extensions.Logging.LogDefineOptions? options);

Type Parameters

T1

The type of the first parameter passed to the named format string.

T2

The type of the second parameter passed to the named format string.

T3

The type of the third parameter passed to the named format string.

T4

The type of the fourth parameter passed to the named format string.

T5

The type of the fifth parameter passed to the named format string.

Parameters

logLevel
LogLevel

The LogLevel.

eventId
EventId

The event ID.

formatString
String

The named format string.

Returns

Action<ILogger,T1,T2,T3,T4,T5,Exception>

A delegate that, when invoked, creates a log message.

Applies to

.NET 9 (package-provided) e outras versões
Produto Versões
.NET 8 (package-provided), 9 (package-provided)
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)
.NET Standard 2.0 (package-provided)

Define<T1,T2,T3,T4,T5>(LogLevel, EventId, String)

Source:
LoggerMessage.cs
Source:
LoggerMessage.cs
Source:
LoggerMessage.cs

Creates a delegate that can be invoked for logging a message.

public static Action<Microsoft.Extensions.Logging.ILogger,T1,T2,T3,T4,T5,Exception?> Define<T1,T2,T3,T4,T5> (Microsoft.Extensions.Logging.LogLevel logLevel, Microsoft.Extensions.Logging.EventId eventId, string formatString);

Type Parameters

T1

The type of the first parameter passed to the named format string.

T2

The type of the second parameter passed to the named format string.

T3

The type of the third parameter passed to the named format string.

T4

The type of the fourth parameter passed to the named format string.

T5

The type of the fifth parameter passed to the named format string.

Parameters

logLevel
LogLevel

The LogLevel.

eventId
EventId

The event ID.

formatString
String

The named format string.

Returns

Action<ILogger,T1,T2,T3,T4,T5,Exception>

A delegate that, when invoked, creates a log message.

Applies to

.NET 9 (package-provided) e outras versões
Produto Versões
.NET 8 (package-provided), 9 (package-provided)
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)
.NET Standard 2.0 (package-provided)

Define<T1,T2,T3,T4>(LogLevel, EventId, String)

Source:
LoggerMessage.cs
Source:
LoggerMessage.cs
Source:
LoggerMessage.cs

Creates a delegate that can be invoked for logging a message.

public static Action<Microsoft.Extensions.Logging.ILogger,T1,T2,T3,T4,Exception?> Define<T1,T2,T3,T4> (Microsoft.Extensions.Logging.LogLevel logLevel, Microsoft.Extensions.Logging.EventId eventId, string formatString);

Type Parameters

T1

The type of the first parameter passed to the named format string.

T2

The type of the second parameter passed to the named format string.

T3

The type of the third parameter passed to the named format string.

T4

The type of the fourth parameter passed to the named format string.

Parameters

logLevel
LogLevel

The LogLevel.

eventId
EventId

The event ID.

formatString
String

The named format string.

Returns

Action<ILogger,T1,T2,T3,T4,Exception>

A delegate that, when invoked, creates a log message.

Applies to

.NET 9 (package-provided) e outras versões
Produto Versões
.NET 8 (package-provided), 9 (package-provided)
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)
.NET Standard 2.0 (package-provided)

Define<T1,T2,T3,T4>(LogLevel, EventId, String, LogDefineOptions)

Source:
LoggerMessage.cs
Source:
LoggerMessage.cs
Source:
LoggerMessage.cs

Creates a delegate that can be invoked for logging a message.

public static Action<Microsoft.Extensions.Logging.ILogger,T1,T2,T3,T4,Exception?> Define<T1,T2,T3,T4> (Microsoft.Extensions.Logging.LogLevel logLevel, Microsoft.Extensions.Logging.EventId eventId, string formatString, Microsoft.Extensions.Logging.LogDefineOptions? options);

Type Parameters

T1

The type of the first parameter passed to the named format string.

T2

The type of the second parameter passed to the named format string.

T3

The type of the third parameter passed to the named format string.

T4

The type of the fourth parameter passed to the named format string.

Parameters

logLevel
LogLevel

The LogLevel.

eventId
EventId

The event ID.

formatString
String

The named format string.

Returns

Action<ILogger,T1,T2,T3,T4,Exception>

A delegate that, when invoked, creates a log message.

Applies to

.NET 9 (package-provided) e outras versões
Produto Versões
.NET 8 (package-provided), 9 (package-provided)
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)
.NET Standard 2.0 (package-provided)

Define<T1,T2,T3>(LogLevel, EventId, String)

Source:
LoggerMessage.cs
Source:
LoggerMessage.cs
Source:
LoggerMessage.cs

Creates a delegate that can be invoked for logging a message.

public static Action<Microsoft.Extensions.Logging.ILogger,T1,T2,T3,Exception?> Define<T1,T2,T3> (Microsoft.Extensions.Logging.LogLevel logLevel, Microsoft.Extensions.Logging.EventId eventId, string formatString);

Type Parameters

T1

The type of the first parameter passed to the named format string.

T2

The type of the second parameter passed to the named format string.

T3

The type of the third parameter passed to the named format string.

Parameters

logLevel
LogLevel

The LogLevel.

eventId
EventId

The event ID.

formatString
String

The named format string.

Returns

A delegate that, when invoked, creates a log message.

Applies to

.NET 9 (package-provided) e outras versões
Produto Versões
.NET 8 (package-provided), 9 (package-provided)
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)
.NET Standard 2.0 (package-provided)

Define<T1,T2,T3>(LogLevel, EventId, String, LogDefineOptions)

Source:
LoggerMessage.cs
Source:
LoggerMessage.cs
Source:
LoggerMessage.cs

Creates a delegate that can be invoked for logging a message.

public static Action<Microsoft.Extensions.Logging.ILogger,T1,T2,T3,Exception?> Define<T1,T2,T3> (Microsoft.Extensions.Logging.LogLevel logLevel, Microsoft.Extensions.Logging.EventId eventId, string formatString, Microsoft.Extensions.Logging.LogDefineOptions? options);

Type Parameters

T1

The type of the first parameter passed to the named format string.

T2

The type of the second parameter passed to the named format string.

T3

The type of the third parameter passed to the named format string.

Parameters

logLevel
LogLevel

The LogLevel.

eventId
EventId

The event ID.

formatString
String

The named format string.

Returns

A delegate that, when invoked, creates a log message.

Applies to

.NET 9 (package-provided) e outras versões
Produto Versões
.NET 8 (package-provided), 9 (package-provided)
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)
.NET Standard 2.0 (package-provided)

Define<T1,T2>(LogLevel, EventId, String)

Source:
LoggerMessage.cs
Source:
LoggerMessage.cs
Source:
LoggerMessage.cs

Creates a delegate that can be invoked for logging a message.

public static Action<Microsoft.Extensions.Logging.ILogger,T1,T2,Exception?> Define<T1,T2> (Microsoft.Extensions.Logging.LogLevel logLevel, Microsoft.Extensions.Logging.EventId eventId, string formatString);

Type Parameters

T1

The type of the first parameter passed to the named format string.

T2

The type of the second parameter passed to the named format string.

Parameters

logLevel
LogLevel

The LogLevel.

eventId
EventId

The event ID.

formatString
String

The named format string.

Returns

A delegate that, when invoked, creates a log message.

Applies to

.NET 9 (package-provided) e outras versões
Produto Versões
.NET 8 (package-provided), 9 (package-provided)
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)
.NET Standard 2.0 (package-provided)

Define<T1,T2>(LogLevel, EventId, String, LogDefineOptions)

Source:
LoggerMessage.cs
Source:
LoggerMessage.cs
Source:
LoggerMessage.cs

Creates a delegate that can be invoked for logging a message.

public static Action<Microsoft.Extensions.Logging.ILogger,T1,T2,Exception?> Define<T1,T2> (Microsoft.Extensions.Logging.LogLevel logLevel, Microsoft.Extensions.Logging.EventId eventId, string formatString, Microsoft.Extensions.Logging.LogDefineOptions? options);

Type Parameters

T1

The type of the first parameter passed to the named format string.

T2

The type of the second parameter passed to the named format string.

Parameters

logLevel
LogLevel

The LogLevel.

eventId
EventId

The event ID.

formatString
String

The named format string.

Returns

A delegate that, when invoked, creates a log message.

Applies to

.NET 9 (package-provided) e outras versões
Produto Versões
.NET 8 (package-provided), 9 (package-provided)
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)
.NET Standard 2.0 (package-provided)

Define<T1>(LogLevel, EventId, String, LogDefineOptions)

Source:
LoggerMessage.cs
Source:
LoggerMessage.cs
Source:
LoggerMessage.cs

Creates a delegate that can be invoked for logging a message.

public static Action<Microsoft.Extensions.Logging.ILogger,T1,Exception?> Define<T1> (Microsoft.Extensions.Logging.LogLevel logLevel, Microsoft.Extensions.Logging.EventId eventId, string formatString, Microsoft.Extensions.Logging.LogDefineOptions? options);

Type Parameters

T1

The type of the first parameter passed to the named format string.

Parameters

logLevel
LogLevel

The LogLevel.

eventId
EventId

The event ID.

formatString
String

The named format string.

Returns

A delegate that, when invoked, creates a log message.

Applies to

.NET 9 (package-provided) e outras versões
Produto Versões
.NET 8 (package-provided), 9 (package-provided)
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)
.NET Standard 2.0 (package-provided)

Define<T1>(LogLevel, EventId, String)

Source:
LoggerMessage.cs
Source:
LoggerMessage.cs
Source:
LoggerMessage.cs

Creates a delegate that can be invoked for logging a message.

public static Action<Microsoft.Extensions.Logging.ILogger,T1,Exception?> Define<T1> (Microsoft.Extensions.Logging.LogLevel logLevel, Microsoft.Extensions.Logging.EventId eventId, string formatString);

Type Parameters

T1

The type of the first parameter passed to the named format string.

Parameters

logLevel
LogLevel

The LogLevel.

eventId
EventId

The event ID.

formatString
String

The named format string.

Returns

A delegate that, when invoked, creates a log message.

Applies to

.NET 9 (package-provided) e outras versões
Produto Versões
.NET 8 (package-provided), 9 (package-provided)
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)
.NET Standard 2.0 (package-provided)