Skip to content

Collection of traits to inject common symfony services

Notifications You must be signed in to change notification settings

kuborgh/symfony-traits

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

symfony-traits

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

About

Collection of traits to inject common symfony services

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages