Class LoggingAttribute
By default, all endpoinds that starts with Api is logged, not other endpoinds. If this attributes is added, logging will be performed on that endpoind independent on the path. To disable logging for an endpoint add the attribute and set the property Enabled=false. For streamed output to work, set the property ResponseBody=false or Enabled=false. Logged request data: Method, Path, Headers (optional), Query (optional), Body (optional), ClientIp Logged response data: StatusCode, Headers (optional), Body (optional)
[AttributeUsage(AttributeTargets.Class|AttributeTargets.Method)]
public class LoggingAttribute : Attribute
- Inheritance
-
LoggingAttribute
- Inherited Members
Properties
Enabled
Enable or disable all logging disregarding other properties.
public bool Enabled { get; set; }
Property Value
RequestBody
Enable or disable logging of the request body.
public bool RequestBody { get; set; }
Property Value
ResponseBody
Enable or disable logging of the request body. This needs to be set to false when the output is streamed.
public bool ResponseBody { get; set; }