Anto Subash.

ABP Framework - Getting started -Part : 8

Centralized logging for .net core ABP microservices app using Seq. Part 8

Table of contents

Intro

In this post we will see how to implement a central logging system for your ABP app using Seq.

Deploy the Seq dockers container

Enable swarm mode

1docker swarm init

Create the docker-compose file seq_stack.yaml

1version: "3.2"
2
3services:
4  seq:
5    image: datalust/seq
6    ports:
7      - 8003:80
8      - 5341:5341
9    volumes:
10      - D:\docker\data\seq:/data
11    environment:
12      ACCEPT_EULA: "Y"

To deploy the stack

1docker stack deploy -c seq_stack.yaml seq

This will deploy the seq docker container.

Create ABP Tired application

1abp new SeqWithAbp -t app -u mvc --tiered

Once the app is created run the DbMigration project to setup the migrations and database seeding.

Install Seq Sink in the projects

Install the Serilog.Sinks.Seq nuget package to the following projects.

  • SeqWithAbp.HttpApi.Host
  • SeqWithAbp.IdentityServer
  • SeqWithAbp.Web

Update the LoggerConfiguration in the Program.cs with the seq endpoint in all the projects.

1.WriteTo.Async(c => c.File("Logs/logs.txt"))
2.WriteTo.Seq("http://localhost:5341")

This will post all the logs to the seq.

Sample Repo : https://github.com/antosubash/SeqWithAbp

Buy Me a Coffee at ko-fi.com