You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In our project, we have the roarr logs of Slonik enabled alongside our own application logs. We'd like to correlate the roarr logs with our existing application logs by adding the connection id into our application log context, while leaving the roarr logs as is. I can see the connection id is present in the interceptor context, but I'm wondering if I there's a way I could retrieve this connection id from the connection itself?
Desired Behavior
After calling pool.connect the resulting connection object contains a connection id that can be accessed to correlate roarr logs with other logs and data.
Motivation
Today we have access to the roarr logs, but using them effectively can be difficult since we cannot easily correlate them with the rest of the contextual data that our services log. If our service is processing two identical requests at the same time, it can become impossible to attribute the roar logs to the individual request context within our application logs.
Implementation
A simple solution for this could be to add a getConnectionId or getContext method into CommonQueryMethods to allow connections and transactions the ability to expose the connection id
The text was updated successfully, but these errors were encountered:
In our project, we have the roarr logs of Slonik enabled alongside our own application logs. We'd like to correlate the roarr logs with our existing application logs by adding the connection id into our application log context, while leaving the roarr logs as is. I can see the connection id is present in the interceptor context, but I'm wondering if I there's a way I could retrieve this connection id from the connection itself?
Desired Behavior
After calling
pool.connect
the resulting connection object contains a connection id that can be accessed to correlate roarr logs with other logs and data.Motivation
Today we have access to the roarr logs, but using them effectively can be difficult since we cannot easily correlate them with the rest of the contextual data that our services log. If our service is processing two identical requests at the same time, it can become impossible to attribute the roar logs to the individual request context within our application logs.
Implementation
A simple solution for this could be to add a
getConnectionId
orgetContext
method intoCommonQueryMethods
to allow connections and transactions the ability to expose the connection idThe text was updated successfully, but these errors were encountered: