Class LogAttribute
Marks an implementation type or method for aspect-style logging via Wrap<T>(T). On a class: applies to all methods of wrapped interfaces. On a method: overrides the class-level attribute for that method. Attributes on interface declarations are ignored.
Call entries are written when Level is enabled. Use Trace when the call should stay quiet unless Trace is on. Exceptions are always logged at Error for attributed methods (when Error is enabled); the method name (± parameters) appears once — either on the entry line or on the error line, not both.
Inherited Members
Namespace: Zaya.Logging.Models
Assembly: Zaya.Logging.dll
Syntax
[AttributeUsage(AttributeTargets.Class|AttributeTargets.Method, AllowMultiple = false, Inherited = true)]
public sealed class LogAttribute : Attribute
Constructors
| Edit this page View SourceLogAttribute(LogLevel)
Initializes a new instance of the LogAttribute class.
Declaration
public LogAttribute(LogLevel level)
Parameters
| Type | Name | Description |
|---|---|---|
| LogLevel | level | Level used when logging the method invocation. |
Properties
| Edit this page View SourceLevel
Level used when logging the method invocation.
Declaration
public LogLevel Level { get; }
Property Value
| Type | Description |
|---|---|
| LogLevel |
LogParameters
When true, the proxy also logs method parameter values.
Declaration
public bool LogParameters { get; init; }
Property Value
| Type | Description |
|---|---|
| bool |