New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
group entries #12
Comments
@sebastianwebber this is really just because of how multithreaded/distributed applications work, the best way is to assign a unique ID, preferably one that’s time stamp sortable, to the start of the logging using WithFields and that will be printed with all your log entries allowing you to filter and sort. I am updating this lib to handle this better. |
HI @joeybloggs ! I don't know how solve this, but sorting a timestamp does not appear to be a solution. Take a look at the example bellow:
Note that I use a field to "group the messages" but, how they are running in a separate goroutine they happen almost at the same time. To solve my problem, i'm thinking sort messages by field, but this turns fields obligatory. This make me think that sort by group its not the better idea for it. The example bellow is sorted. Take a look:
|
@sebastianwebber until I finish the updates to the library, there won't be a great way to solve this. but I was referring to the same process using a unique ID, not a timestamp such as https://github.com/segmentio/ksuid |
@sebastianwebber I buried my head into updating this lib over the weekend, it's mostly the same, let me know if you run into any issues. |
Hi there,
there is possible group log entries? Im trying to print multiple log entries for a unique action, eg:
but when I use the same logic in multiple goroutines, become insane:
Any ideia about this issue?
Thanks
The text was updated successfully, but these errors were encountered: