Book Image

ServiceStack 4 Cookbook

Book Image

ServiceStack 4 Cookbook

Overview of this book

Table of Contents (18 chapters)
ServiceStack 4 Cookbook
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Logging with a choice of frameworks


In this recipe, we will look at a few ways ServiceStack allows you to perform logging in your application. There are lots of options to choose from in log frameworks in .NET, and a lot of developers have specific frameworks they prefer. ServiceStack provides a couple of simple interfaces to enable developers to make their own choice while still providing simple implementations for developers who just want to get something logging. Let's have a look at some of our choices.

Note

Note that evolving your logging strategy over time might require looking at several different concepts—auditing, tracing, access logs, error logs, and others included. We'll cover a simple scenario to get you started down this path in this recipe—a full exploration is outside of the scope of this book.

Getting ready

First, we need some services to log from. We are going to use the GreetingsService class to show a simple example of how we can incorporate logging into our ServiceStack...