4 * This file is part of the Monolog package.
6 * (c) Jordi Boggiano <j.boggiano@seld.be>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Monolog\Processor;
15 * Adds a unique identifier into records
17 * @author Simon Mönch <sm@webfactory.de>
23 public function __construct($length = 7)
25 if (!is_int($length) || $length > 32 || $length < 1) {
26 throw new \InvalidArgumentException('The uid length must be an integer between 1 and 32');
29 $this->uid = substr(hash('md5', uniqid('', true)), 0, $length);
32 public function __invoke(array $record)
34 $record['extra']['uid'] = $this->uid;
42 public function getUid()