abp
seq
dotnet
In this post we will see how to implement a central logging system for your ABP app using Seq.
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"
1docker stack deploy -c seq_stack.yaml seq
This will deploy the seq docker container.
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 the Serilog.Sinks.Seq
nuget package to the following projects.
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