/// <summary>
 /// Add ThreadId to Logging logger for Serilog
 /// </summary>
 /// <param name="enrich"></param>
 /// <returns></returns>
 public static LoggerConfiguration WithThreadId(this LoggerEnrichmentConfiguration enrich)
 {
     return(enrich.WithDynamicProperty(
                "ThreadId",
                () => {
         var threadId = Thread.CurrentThread.ManagedThreadId.ToString();
         return $"ThreadId: {threadId} ";
     }
                ));
 }
    /// <summary>
    /// Add MemoryUsage to Logging logger for Serilog
    /// </summary>
    /// <param name="configuration"></param>
    /// <param name="prettySize"></param>
    /// <returns></returns>
    public static LoggerConfiguration WithMemoryUsage(
        this LoggerEnrichmentConfiguration configuration,
        bool prettySize = false
        )
    {
        var proc       = Process.GetCurrentProcess();
        var memorySize = proc.PrivateMemorySize64;

        return(configuration.WithDynamicProperty(
                   "MemoryUsage",
                   () => {
            var mem = prettySize ? memorySize.SizeFormat() : memorySize.ToString();

            return $" {mem} ";
        }
                   ));
    }