The logging is IO bound, you can organize consumer/producer queue instead of calling logger methods directly and depending on log format multiple requests can be combined (bulk-written). I did something similar in past and at cost of higher memory consumption it worked pretty well to write thousands of log entries at once every 2 seconds or so.
↧