I’m writing .NET Core application and would like to use structured logging available in .NET Core Logging Extensions to write logs in more structured way. I want to save my logs in RavenDB and I’m wonder are there any best practices for use case like this? I’m new to Document DB’s and I cannot predict things in future like I’m used to in SQL relational databases. My main consideration are:
I think each log entry should go into a separated document for the following reasons:
I think structured data should go in classical JSON properties form. For example:
{
"State": {
"Service": "International Weather Forecast Service",
"{OriginalFormat}": "Weather forecast called using {Service}"
}
}
There is a project on GitHub that follows the grouping approach RavenDB.StructuredLog. But I think it is not the right one, so I created mine: Logging.Raven