Code Monkey home page Code Monkey logo

aspnetcore-effective-logging's Introduction

ASP.NET Core -- Effective Logging

This repo contains code that was used (and is kept up-to-date) from the Effective Logging in ASP.NET Core course on Pluralsight, which I authored.

It includes references to BOTH Serilog and NLog and various commits will change the logging framework from one to the other.

A couple of key recent updates have been made that might be of interest:

Approach

Since I needed to be able to switch from one logging framework to another, I took an approach with this set of applications to tap primarily into the Microsoft.Logging.Extensions functionality rather than use Serilog Enrichers.

Getting Started

There are two projects that should be set to run in this repo:

  • BookClub.UI (this is the user interface - and it makes calls to the API project)
  • BookClub.API (this is the API which has all of the database interactions)

The API projects appsettings.json file has a connection string that looks for a BookClub database on a local SQLExpress instance. If you don't have one BookClub database:

  • Optional: Download Microsoft® SQL Server® 2017 Express and SQL Server Management Studio (SSMS).
  • Create a database called BookClub in some instance of SQL Server. Express is fine, so is the Docker version.
  • Use the 4 files in the BookClub.Data/Schema folder to set up the BookClub database:
    • Create the Book table by running the SQL in Book.sql
    • Insert a couple of rows by running the SQL in InitialData.sql
    • Create stored procedures by running the SQL in both the GetAllBooks.sql and InsertBook.sql (each creates a proc)
  • Update the connection string in BookClub.API/appsettings.json to point to the database.

Run the solution! :)

Exploring

There aren't that many pages / API methods here, and the best way to really explore what's going on is to simply try some of the pages and look at the code inside them, along with setting some breakpoints both in the UI and the API code.

aspnetcore-effective-logging's People

Contributors

dahlsailrunner avatar rick-anderson avatar terryaney avatar dependabot[bot] avatar sucrose0413 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.