Skip to main content

IRequestLogger

Log every service request

Assembly: ServiceStack.Interfaces.dll
View Source
Declaration
public interface IRequestLogger

Properties

EnableSessionTracking

Turn On/Off Session Tracking

View Source
Declaration
bool EnableSessionTracking { get; set; }

EnableRequestBodyTracking

Turn On/Off Raw Request Body Tracking

View Source
Declaration
bool EnableRequestBodyTracking { get; set; }

RequestBodyTrackingFilter

Turn On/Off Raw Request Body Tracking per-request

View Source
Declaration
Func<IRequest, bool> RequestBodyTrackingFilter { get; set; }

EnableResponseTracking

Turn On/Off Tracking of Responses

View Source
Declaration
bool EnableResponseTracking { get; set; }

ResponseTrackingFilter

Turn On/Off Tracking of Responses per-request

View Source
Declaration
Func<IRequest, bool> ResponseTrackingFilter { get; set; }

EnableErrorTracking

Turn On/Off Tracking of Exceptions

View Source
Declaration
bool EnableErrorTracking { get; set; }

LimitToServiceRequests

Limit logging to only Service Requests

View Source
Declaration
bool LimitToServiceRequests { get; set; }

RequiredRoles

Limit access to /requestlogs service to role

View Source
Declaration
string[] RequiredRoles { get; set; }

SkipLogging

Don't log matching requests

View Source
Declaration
Func<IRequest, bool> SkipLogging { get; set; }

ExcludeRequestDtoTypes

Don't log requests of these types.

View Source
Declaration
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
Declaration
Type[] HideRequestBodyForRequestDtoTypes { get; set; }

ExcludeResponseTypes

Don't log Response DTO Types

View Source
Declaration
Type[] ExcludeResponseTypes { get; set; }

RequestLogFilter

Customize Request Log Entry

View Source
Declaration
Action<IRequest, RequestLogEntry> RequestLogFilter { get; set; }

IgnoreFilter

Customize which instances should not be serialized

View Source
Declaration
Func<object, bool> IgnoreFilter { get; set; }

CurrentDateFn

Change what DateTime to use for the current Date (defaults to UtcNow)

View Source
Declaration
Func<DateTime> CurrentDateFn { get; set; }

Methods

Log(IRequest, Object, Object, TimeSpan)

Log a request

View Source
Declaration
void Log(IRequest request, object requestDto, object response, TimeSpan elapsed)
Parameters
TypeNameDescription
ServiceStack.Web.IRequestrequestThe 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
Declaration
List<RequestLogEntry> GetLatestLogs(int? take)
Returns

System.Collections.Generic.List<ServiceStack.RequestLogEntry>

Parameters
TypeName
System.Nullable<System.Int32>take