diff --git a/CHANGELOG.next.asciidoc b/CHANGELOG.next.asciidoc index 5f64d98eb96..a1c8df5256c 100644 --- a/CHANGELOG.next.asciidoc +++ b/CHANGELOG.next.asciidoc @@ -186,6 +186,7 @@ Setting environmental variable ELASTIC_NETINFO:false in Elastic Agent pod will d - Add support for PEM-based Okta auth in CEL. {pull}37813[37813] - Add ETW input. {pull}36915[36915] - Update CEL mito extensions to v1.9.0 to add keys/values helper. {pull}37971[37971] +- Add logging for cache processor file reads and writes. {pull}38052[38052] *Auditbeat* diff --git a/libbeat/processors/cache/file_store.go b/libbeat/processors/cache/file_store.go index 1ab4ab21ae4..d3820600acf 100644 --- a/libbeat/processors/cache/file_store.go +++ b/libbeat/processors/cache/file_store.go @@ -185,6 +185,7 @@ func (c *fileStore) readState() { // through all the elements. If any survive the filter, we // were alive, otherwise delete the file. + c.log.Infow("reading state from file", "id", c.id, "path", c.path) dec := json.NewDecoder(f) for { var e CacheEntry @@ -209,6 +210,7 @@ func (c *fileStore) readState() { heap.Push(&c.expiries, &e) } + c.log.Infow("got state from file", "id", c.id, "entries", len(c.cache)) if len(c.cache) != 0 { return } @@ -243,6 +245,7 @@ func (c *fileStore) writeState(final bool) { if !c.dirty { return } + c.log.Infow("write state to file", "id", c.id, "path", c.path) if len(c.cache) == 0 && final { err := os.Remove(c.path) if err != nil { @@ -278,6 +281,7 @@ func (c *fileStore) writeState(final bool) { if err != nil { c.log.Errorw("failed to finalize writing state", "error", err) } + c.log.Infow("write state to file sync and replace succeeded", "id", c.id, "path", c.path) }() enc := json.NewEncoder(f) @@ -297,4 +301,5 @@ func (c *fileStore) writeState(final bool) { } // Only mark as not dirty if we succeeded in the write. c.dirty = false + c.log.Infow("write state to file succeeded", "id", c.id, "path", c.path) }