kuborgh/symfony-traits

A collection of traits to inject symfony services

Installs: 11

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 0

Open Issues: 0

pkg:composer/kuborgh/symfony-traits

dev-master 2016-06-15 14:59 UTC

This package is not auto-updated.

Last update: 2025-09-28 00:34:49 UTC


README

Collection of traits to inject common symfony services

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);
}