IRequestLogger
Log every service request
Assembly: ServiceStack.Interfaces.dll
View Source
public interface IRequestLogger
Properties
EnableSessionTracking
Turn On/Off Session Tracking
View Source
bool EnableSessionTracking { get; set; }
EnableRequestBodyTracking
Turn On/Off Raw Request Body Tracking
View Source
bool EnableRequestBodyTracking { get; set; }
RequestBodyTrackingFilter
Turn On/Off Raw Request Body Tracking per-request
View Source
Func<IRequest, bool> RequestBodyTrackingFilter { get; set; }
EnableResponseTracking
Turn On/Off Tracking of Responses
View Source
bool EnableResponseTracking { get; set; }
ResponseTrackingFilter
Turn On/Off Tracking of Responses per-request
View Source
Func<IRequest, bool> ResponseTrackingFilter { get; set; }
EnableErrorTracking
Turn On/Off Tracking of Exceptions
View Source
bool EnableErrorTracking { get; set; }
LimitToServiceRequests
Limit logging to only Service Requests
View Source
bool LimitToServiceRequests { get; set; }
RequiredRoles
Limit access to /requestlogs service to role
View Source
string[] RequiredRoles { get; set; }
SkipLogging
Don't log matching requests
View Source
Func<IRequest, bool> SkipLogging { get; set; }
ExcludeRequestDtoTypes
Don't log requests of these types.
View Source
Type[] ExcludeRequestDtoTypes { get; set; }
HideRequestBodyForRequestDtoTypes
Don't log request bodys for services with sensitive information. By default Auth and Registration requests are hidden.
View Source
Type[] HideRequestBodyForRequestDtoTypes { get; set; }
ExcludeResponseTypes
Don't log Response DTO Types
View Source
Type[] ExcludeResponseTypes { get; set; }
RequestLogFilter
Customize Request Log Entry
View Source
Action<IRequest, RequestLogEntry> RequestLogFilter { get; set; }
IgnoreFilter
Customize which instances should not be serialized
View Source
Func<object, bool> IgnoreFilter { get; set; }
CurrentDateFn
Change what DateTime to use for the current Date (defaults to UtcNow)
View Source
Func<DateTime> CurrentDateFn { get; set; }
Methods
Log(IRequest, Object, Object, TimeSpan)
Log a request
View Source
void Log(IRequest request, object requestDto, object response, TimeSpan elapsed)
Parameters
Type | Name | Description |
---|---|---|
ServiceStack.Web.IRequest | request | The RequestContext |
|
| System.Object
| requestDto | Request DTO
|
| System.Object
| response | Response DTO or Exception
|
| System.TimeSpan
| elapsed | How long did the Request take
|
GetLatestLogs(Nullable<Int32>)
View the most recent logs
View Source
List<RequestLogEntry> GetLatestLogs(int? take)
Returns
System.Collections.Generic.List<ServiceStack.RequestLogEntry>
Parameters
Type | Name |
---|---|
System.Nullable<System.Int32> | take |