Skip to content

How to add a logger (Serilog) to Runtime #1204

Answered by bmazzarol
davidyu2023 asked this question in Q&A
Discussion options

You must be logged in to vote

The recipe outlined in the wiki has 4 components,

  1. Trait interface, this gives the runtime access to the IO implementation
  2. Interface for the IO itself, in your case it's a way to log.
  3. Implementations of the IO to plug into your runtime
  4. A Generic Static class (module/service ), which uses the IO via the trait interface. This is the surface area you expose to develop against.

I recommend looking through the existing traits exposed by Sys and reading the wiki again. Build something simple and iterate on it.

IMHO serilog would be an implementation detail, the capability is logging, the backing library that does it can be anything.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@davidyu2023
Comment options

@louthy
Comment options

@davidyu2023
Comment options

Answer selected by davidyu2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants