lograge icon indicating copy to clipboard operation
lograge copied to clipboard

How to process old log entries

Open neohunter opened this issue 6 years ago • 1 comments

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?

neohunter avatar Jan 16 '19 03:01 neohunter

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.

ziggythehamster avatar May 31 '19 18:05 ziggythehamster