Book Image

Mastering ServiceStack

By : Andreas Niedermair
Book Image

Mastering ServiceStack

By: Andreas Niedermair

Overview of this book

Table of Contents (13 chapters)

Request logging


One key aspect is the detection of problematic requests in a high load scenario and the ability to reproduce the issues the consumer is facing with the same parameters.

The easiest way to add logging of such requests to your service is to use the request logger:

using Funq;
using ServiceStack;

public override void Configure(Container container)
{
  this.Plugins.Add(new RequestLogsFeature());
}

You can further customize the log entries by adapting the following properties of the RequestLogsFeature object:

  • AtRestPath (default: /requestlogs): The route that exposes the gathered logs.

  • EnableSessionTracking (default: false): If set to true, the request's associated ServiceStack.Auth.IAuthSession instance is added to the Session property of the log entries.

  • EnableRequestBodyTracking (default: false): It adds the raw request body to the RequestBody property of log entries to verify deserialization or to get insight into the raw request stream.

  • EnableResponseTracking (default: false...