Closed daljeet-singh closed 11 years ago
Did you solve this issue? I can't find out the way!
Ok, I got it.
What did you do to fix it?
Ok, I should write the steps before.
First of all, thanks for share your work @kvz .
cbRestlogFilter
was returning null just before save.restlogFilter
'cbRestlogFilter' => 'restlogFilter',
restlofFilter
in our Controllerpublic function restlogFilter ($Rest, $log) {
if (Configure::read('App.api.log') === true) {
// You could also do last minute changes to the data being logged
return $log;
}
// Or return false to prevent logging alltogether
return false;
}
I think there's a lack of documentation in this section in the README, but it's not difficult to get the solution following the code.
Thank you! I don't actively maintain this plugin but if you want to submit a documentation update PR I'm sure I can merge it
We can use this in simple way
public $components = array( 'Rest.Rest' => array(
'catchredir' => true,
'log' => array(
'model' => 'Rest.RestLog',
'pretty' => true,
),
'actions' => array(
'index' => array(
'extract' => array( 'orders' ),
),
'view' => array(
'extract' => array( 'orderDetail' ),
),
'add' => array(
'extract' => array( 'message' ),
),
),
),
);
And in AppController
public function restlogFilter ($Rest, $log) {
return $log;
}
And in Plugin's Modal just define extra db config
public $useDbConfig = 'mongo';
How to enable writing log to my DB?