PostSharp 6.10 / / Post­Sharp Documentation / API Reference / Post­Sharp.​Patterns.​Diagnostics Namespace / Logger­Factory­Extensions Class / Logger­Factory­Extensions Methods / Logger­Factory­Extensions.​Get­Log­Source Method / Logger­Factory­Extensions.​Get­Log­Source Method (ILogger­Factory3, String)

LoggerFactoryExtensions.GetLogSource Method (ILoggerFactory3, String)

Gets a LogSource for a given role and sourceName.

Namespace:  PostSharp.Patterns.Diagnostics
Assembly:  PostSharp.Patterns.Common (in PostSharp.Patterns.Common.dll) Version: (
public static LogSource GetLogSource(
	this ILoggerFactory3 factory,
	string sourceName


Type: PostSharp.Patterns.Diagnostics.Custom.ILoggerFactory3
An ILoggerFactory3.
Type: System.String
Log source name to be used by the backend. Not all backends support creating sources by name.

Return Value

Type: LogSource
A LogSource for sourceName.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type ILoggerFactory3. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also