mirror of
https://github.com/Seldaek/monolog.git
synced 2025-07-30 18:00:17 +02:00
WebProcessor: option to add only requested extra fields, instead of always adding all available
This commit is contained in:
@@ -73,6 +73,21 @@ class WebProcessorTest extends TestCase
|
||||
$this->assertFalse(isset($record['extra']['unique_id']));
|
||||
}
|
||||
|
||||
public function testProcessorAddsOnlyRequestedExtraFields()
|
||||
{
|
||||
$server = array(
|
||||
'REQUEST_URI' => 'A',
|
||||
'REMOTE_ADDR' => 'B',
|
||||
'REQUEST_METHOD' => 'C',
|
||||
'SERVER_NAME' => 'F',
|
||||
);
|
||||
|
||||
$processor = new WebProcessor($server, array('url', 'http_method'));
|
||||
$record = $processor($this->getRecord());
|
||||
|
||||
$this->assertSame(array('url' => 'A', 'http_method' => 'C'), $record['extra']);
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException UnexpectedValueException
|
||||
*/
|
||||
|
Reference in New Issue
Block a user