Proposal to have all data be key/value data in Log

What would the benefit be over Log::Context? Especially when the the first idea from Log Module Suggestions is implemented. The way I think if of logging is a message with associated metadata that gives information related to given event/message, i.e. context. The message would be human readable while the context could be processed by machines in addition to the message.

Based on your example I would think Log.info(query: sql_query, args: args) { "Fetching users" } would be a better API. Since each backend/formatter has access to the Log::Entry they are free to access the context object to do whatever to it, while also having access to the other entry properties. Based on that Dexter link, what you’re doing seems kinda redundant versus just using the new Log module directly. Especially since there is now an actual container/structured way of storing context versus only having the message to work with.

1 Like