[MGNLCACHE-231] Improve cache debug/trace logging Created: 07/Aug/20  Updated: 08/Apr/21  Resolved: 21/Sep/20

Status: Closed
Project: Cache Modules
Component/s: None
Affects Version/s: 5.9.1
Fix Version/s: 5.9.2

Type: Improvement Priority: Neutral
Reporter: Richard Gange Assignee: Federico Grilli
Resolution: Done Votes: 1
Labels: maintenance
Remaining Estimate: 0d
Time Spent: 3h
Original Estimate: Not Specified

Issue Links:
Relates
relates to MGNLCACHE-232 Cache flush counts from JMX bean not ... Open
dependency
is depended upon by MGNLADVCACHE-112 DOC: Clarify that site aware caching ... Closed
relation
is related to DOCU-2044 Troubleshooting page for cache issues Closed
is related to MGNLADVCACHE-116 Site aware caching no longer creates ... Closed
is related to EXTDAM-287 Provide a command for flushing a cach... Open
is related to MGNLADVCACHE-110 Improve advanced cache debug/trace lo... Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Sprint: Maintenance 25
Story Points: 0.5

 Description   

To better help customers verify their cache configurations it would be useful to see the cache flush events confirmed in the log. Especially since the introduction of the site aware cache policy. I would like to be able to see the cache flush confirmed in the log at the debug level:

log.trace("Cache flushed: {}", cacheName);

Features added:

  • Each flush command now has TRACE level logging for flush events including names of caches being flushed.
  • Observation registration for cache flushing is now recorded at TRACE level. Can be seen during startup phase of the cache module.
  • FlushAllListeningPolicy records flush events at TRACE level which includes the name of the cache being flushed.
  • CachePolicyResult #toString() method updated to include the name of the cache being used. This can be observed by turning the cache filter to DEBUG.

Enable debug/trace in log4j2:

<Logger name="info.magnolia.module.cache" level="ALL"/>

Generated at Sun Feb 11 23:53:29 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.