Cache on disk works not good
Hi everybody, To protect the logs from loss, I turned on the recommended settings in client's config:
PersistLogqueue TRUE SyncLogqueue TRUE CacheFlushInterval always CacheSync TRUE
But now I see that parts of log are duplicated much more often than before these setting was enabled. Why cache in memory works better? In case with cache on disk I hope to see best result.
Thank you so much!
None of those settings should duplicate events.
PersistLogqueue TRUE
Writes the normal log queue to disk instead of RAM. Note that logqueue is written to disk when NXLog shuts down, regardless.
SyncLogqueue TRUE
Immediately syncs the logqueue to disk after each entry.
CacheFlushInterval always
Indicates that the in-memory value will be flushed to cache file after everytime a module sets a value. Default is 5seconds between flush
CacheSync TRUE
Bypasses filesystem buffering to force sync the cache to disk. Without this setting, the in-memory cache gets flushed to cache file and then waits on the filesystem to sync to disk.
If you are getting duplicate events then there is likely another setting in your config or source that is causing the duplications.
I would reference the rest of your config and see if something else may be causing it. As a troubleshooting step you could also flip the values on each of those settings to see which may be related to the duplicate messages.