I have created a new module with my crontab.xml
:
<config>
<group id="default">
<job name="order_read" instance="Cincuenta\CronOrders\Model\Orders" method="readOrders">
<schedule>*/5 * * * *</schedule>
</job>
</group>
</config>
Also i got a CronOrders/Model/Orders.php
with the function :
public function readOrders(){
$writer = new \Zend\Log\Writer\Stream(BP . '/var/log/loggy.log');
$logger = new \Zend\Log\Logger();
$logger->addWriter($writer);
$logger->info('LOG1');
...
I had try to run by command with
php bin/magento cron:run
and
php bin/magento cron:run --group:"default"
But the log is not been created. I also tested my log code and it runs in others functions well.
Any error with the crons in Magento 2 or I'm missing something?
cron:run
two times?