<?php
namespace OxidEsales\LoggerDemo\Controller;
//namespace OxidEsales\LoggerDemo\Model;
use OxidEsales\EshopCommunity\Core\Controller\Base\ShopControl;
use OxidEsales\Eshop\Core\Registry;
class MyShopControl extends ShopControl_parent
{
public function start($controllerKey = null, $function = null, $parameters = null, $viewsChain = null)
{
return 444;
}
public function init()
{
parent::init();
// Log the class name
$logger = Registry::getLogger();
$logger->debug(__METHOD__ . ': Using ' . __CLASS__);
}
}
Hey, we need a little more clarity on the problem you’re having. What exactly is not working? Are there any error messages in the admin area or in the log? Could it be that your LogLevel is not set to Debug?
Also, I wonder if your module is even active and if the current configuration is registered for it. Have you checked if your namespace is registered? Normally you get an error if your class can’t be found. You can also check in vendor/composer/autoload_psr4.php if your namespace is registered correctly.
It is also noticeable that you extend from EshopCommunity, although you should not do that, but Eshop. Otherwise it would break the inheritance chain, making your module not edition independent: