library symfony-traits
A collection of traits to inject symfony services
kuborgh/symfony-traits
A collection of traits to inject symfony services
- Wednesday, June 15, 2016
- by kuborgh-hgiesenow
- Repository
- 2 Watchers
- 0 Stars
- 5 Installations
- PHP
- 0 Dependents
- 0 Suggesters
- 0 Forks
- 0 Open issues
- 1 Versions
- 0 % Grown
symfony-traits
Collection of traits to inject common symfony services, (*1)
Usage
Logger
use LoggerTrait;
...
try {
doSomeStuff($id);
} catch (\Exception $exc) {
// Log Exception text and type in context
$logCtx = $this->logContextFromException($exc);
// Add additional specific context
$logCtx['id'] = $id;
// Log away
$this->logError('Error in doing some stuff', $logCtx);
}