urielha / log4stash

Module to Log log4net Messages to ElasticSearch
MIT License
60 stars 44 forks source link

Not clear what these properties do #77

Open dariusdev opened 3 years ago

dariusdev commented 3 years ago

Can someone explain what these properties do?

`2000

10000 False False

`

urielha commented 3 years ago

Sure,

Bulk properties

The indexing to Elasticsearch are sent by bulk and not one by one.
So on each call to "log" it will be accumulated until we have enough messages to sent or until a timeout is reached.

BulkSize

Number of messages to save in the memory before sending to Elasticsearch.

Possible values:

BulkIdleTimeout

As described, once this timeout (in milliseconds) is reached the current messages that are waiting in the bulk will be sent to elastic even if BulkSize isn't reached.

This action happens at a different thread than your code.

DropEventsOverBulkLimit

Sometimes users are ok with loosing some log messages in favor of memory and I/O. You can set this property to True in order to:

IndexAsync

Whether to send the requests to Elasticsearch in an async manner.
Technically it will use .net async/await for this.

If sets to True each http request won't block your code and will call an async function that will send the request in different task.

If sets to False each http request will block your code which called the log function until it's done.

Pay attention that if BulkSize is greater than 1, not all calls to "log" will be blocked but only the last one that caused the bulk size to reach it's maximum size.