When logging from multiple processes into the same file, the file will be corrupted.
To prevent that, the file could be locked during the actual write, and the lock could be released after that.
I am writing something fairly similar to this and archived over 2 million messages/sec with that approach.
When logging from multiple processes into the same file, the file will be corrupted. To prevent that, the file could be locked during the actual write, and the lock could be released after that. I am writing something fairly similar to this and archived over 2 million messages/sec with that approach.
Here is my approach if you want to get some inspiration: https://gist.github.com/JKamsker/0de2d65ba0730d89022e7aea83ca7643