Skip to content

sgryphon/jsnlog-tracecontext-example

Repository files navigation

Distributed logging example

Pre-requisites

  • Docker
  • Node.JS
  • Dotnet

Logging back end (Seq)

docker-compose up

Client app

cd client/weather-app
npm install
copy-item ../../lib/client/* ./node_modules/jsnlog/ -recurse -force -verbose
npm run start

Server app

cd server/weather-api
dotnet restore
dotnet run

Result

See seq-logs.png and console-logs.png

The Seq logs can be correlated on TraceId.

In the console output, you will see the scope for the incoming web request to the forwarded log handler has it's own TraceId, which is overridden by the inner scope for each log message. JSNLog can batch forwarded log messages, so one request may have multiple client logs, potentially from different traces.

About

Example of TraceContext support for JSNLog

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors