arrow-left

All pages
gitbookPowered by GitBook
1 of 1

Loading...

Installation and Project Setup

hashtag
Installation

Find the package manager and type install-package Perigee. It's available on NuGetarrow-up-right.

hashtag
License Installation

To install your .license file, simply add it to the projects root folder and set it to "Copy Always".

Installation on a deployed application is exactly the same! Make sure the .license is in the executable directory.

circle-check

hashtag
It's very important to set the "Copy to Output Directory" to "Copy Always" under the property inspector - otherwise the build can't see the file!

hashtag
Basic Configuration

To actually use the logging, we need a basic appsettings.json file in the project.

A) Either drop the included sample configuration into the project

B) OR - Create the file (appsettings.json) in the root of the project with the code below:

circle-check

hashtag
It's very important to set the "Copy to Output Directory" to "Copy Always" under the property inspector - otherwise the build can't see the file!

We will cover additional logging and configuration in later!

hashtag
A quick word on "Using" Statements

Since we use Serilog, you may be inclined to use those namespaces at the top of your code. Typically speaking, we import the Microsoft.Extensions.Logging package instead. Since Serilog extends that generic functionality, we can do everything we need to with its inclusion. To get access to the logging functions, put this include at the top of the project:

You can always click the đź’ˇicon or press ctrl+. to find missing namespaces:

That's it! Perigee is installed and ready to go. Head to the next section, let's write our first "Hello Perigee!" application

file-download
223B
appsettings.json
arrow-up-right-from-squareOpen
/HelloLogs
{
  "ConnectionStrings": {
  
  },
  "AppSettings": {
  
  },
  "Perigee": { "HideConsole": false },
  "Serilog": {
    "MinimumLevel": "Debug",
    "WriteTo": [
      { "Name": "Console" }
    ]
  }
}
using Microsoft.Extensions.Logging;
using Perigee;