1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-10-22 17:16:18 +02:00

Better naming

This commit is contained in:
Simon Mönch
2013-02-26 10:19:42 +01:00
parent bad76ce2a6
commit 9cf31da70d
3 changed files with 11 additions and 11 deletions

View File

@@ -0,0 +1,36 @@
<?php
/*
* This file is part of the Monolog package.
*
* (c) Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Monolog\Processor;
/**
* Adds a unique identifier into records
*
* @author Simon Mönch <sm@webfactory.de>
*/
class UidProcessor
{
private static $uid;
public function __construct()
{
if (null === self::$uid) {
self::$uid = substr(hash('md5', uniqid('', true)), 0, 7);
}
}
public function __invoke(array $record)
{
$record['extra']['uid'] = self::$uid;
return $record;
}
}