in the config, for example (pseudo):

```php
public function getCache()
{
    if ($this->cache) {
        // obviously not creating it every time, but you get the point:
        return new LoggedCache($this->cache, $this->logger);
    }

    return $this->cache;
}
```