This code snippet is not the same as the example from the docs.

You have CakeLog::config('shops',... twice, where as the docs have one for 
shops and one for payments.

On Sunday, 9 September 2012 03:54:48 UTC+10, chronon wrote:
>
> I'm struggling with getting logging scopes working (CakePHP 2.2.2). 
> Copying the example in 
> docs<http://book.cakephp.org/2.0/en/core-libraries/logging.html#logging-scopes>
>  doesn't 
> seem to work as it should:
>
> // configure tmp/logs/shops.log to receive all types (log levels), but only// 
> those with `orders` and `payments` scopeCakeLog::config('shops', array(
>     'engine' => 'FileLog',
>     'types' => array(),
>     'scopes' => array('orders', 'payments'),
>     'file' => 'shops.log',));
> // configure tmp/logs/payments.log to receive all types, but only// those 
> with `payments` scopeCakeLog::config('shops', array(
>     'engine' => 'FileLog',
>     'types' => array(),
>     'scopes' => array('payments'),
>     'file' => 'payments.log',));
> CakeLog::warning('this gets written only to shops.log', 
> 'orders');CakeLog::warning('this gets written to both shops.log and 
> payments.log', 'payments');CakeLog::warning('this gets written to both 
> shops.log and payments.log', 'unknown');
>
> All I get is payments.log with all three messages and no shops.log. Any 
> ideas?
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
Visit this group at http://groups.google.com/group/cake-php?hl=en.


Reply via email to