Exemplo n.º 1
0
        public void WriteJson(Stream stream)
        {
            using var writer = new Utf8JsonWriter(stream);

            writer.WriteStartObject();
            writer.WriteString("created_at", CreatedAt);
            writer.WriteNumber("event_id", EventId.Id);
            writer.WriteString("event_name", EventId.Name);
            writer.WriteString("log_name", LogName);
            writer.WriteString("log_level", GetLogName(LogLevel));
            writer.WriteString("message", Message);
            writer.WriteCollection("renderings", Renderings);
            writer.WriteCollection("data", Data);
            writer.WriteCollection("scope", Scope);
            writer.WriteCollection("baggage", Baggage);
            writer.WriteEndObject();
            writer.Flush();
        }