Skip to content

Commit 5fdcd1e

Browse files
committed
Update: Add log to cached files
1 parent 11876e8 commit 5fdcd1e

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Classes/Controller/ReverseProxyController.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
use Neos\Flow\Log\Utility\LogEnvironment;
1313
use Neos\Flow\Mvc\Controller\ActionController;
1414
use Psr\Http\Message\ResponseInterface;
15+
use Psr\Log\LoggerInterface;
1516

1617
/**
1718
* @Flow\Scope("singleton")
@@ -24,6 +25,12 @@ class ReverseProxyController extends ActionController
2425
*/
2526
protected $cache;
2627

28+
/**
29+
* @Flow\Inject
30+
* @var LoggerInterface
31+
*/
32+
protected $logger;
33+
2734
public function __construct()
2835
{
2936
$this->get = new Browser();
@@ -78,6 +85,10 @@ public function fileAction(string $filename)
7885
if (\strlen($config['output'])) {
7986
// 60 * 60 * 6 = 21600 = 6 hours
8087
$this->cache->set($cacheIdentifier, $config, ['CarbonPlausible_Cache'], 21600);
88+
$this->logger->debug(
89+
"Cached $url as \"$cacheIdentifier\"",
90+
LogEnvironment::fromMethodName(__METHOD__)
91+
);
8192
}
8293
return $config['output'];
8394
}

0 commit comments

Comments
 (0)