I'm trying to ensure that CakePHP writes to a custom log file when my app is in production mode.
I'm writing to the log using the log method:-
$this->log($url, 'payment');
This work's fine when I'm in a development mode, but when I switch to production mode it no longer writes to the file (which is what I want it to do).
I've tried configuring a file logging option in bootstrap.php which is partially fixing the issue:-
CakeLog::levels(array('payment'));
CakeLog::config('payment', array(
'engine' => 'FileLog',
'types' => array('payment'),
'file' => 'payment',
));
This now writes to the log file in production mode, but it is also writing other errors to my payment.log which I don't want in there.
I've tried reading through the docs but either it doesn't explain how to achieve this or I am misunderstanding it.
What am I doing wrong? Thanks for any help.