ElasticSearch logger implementation.
Messages are queued and written to the server when any of the following
conditions are met:
- The message queue is full.
- The message to be logged has a LogLevel of
critical
or higher.
- A message is queued to be logged, and more time than the
maxLogInterval
constructor argument has passed.
- The logger is asked to log the message "Main thread exiting".
The name of the index that the logger writes messages to is determined by a
function (the
indexCreator
constructor argument). This usually returns an
index name based off of the current time.