How to process old log entries
I want to use lograge to process my last 30 days log entries. As I've multiple instances running my logs are really hard to read, each hit is mixed. Its possible to use lograge to convert it to a single line?
You're writing the log concurrently in multiple threads/processes. You have to synchronize I/O in order to prevent writing each thread's data in a random order. If you were using syslog, you could make sure each thread checked out a syslog connection and then each thread would not conflict. For disk I/O in Ruby, I think you should be able to just ensure that you're configuring the logger to use a new logger instance on each thread - use something like Concurrent::ThreadLocalVar for that.