creamio / symfony_basebundle
Core bundle for CreamIO bundles in symfony
This package's canonical repository appears to be gone and the package has been frozen as a result.
Installs: 155
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- php: ^7.2
- ext-iconv: *
- ext-json: *
- gbprod/uuid-normalizer: ^1.1
- jms/serializer-bundle: ^2.0
- ramsey/uuid-doctrine: ^1.4
- sensio/framework-extra-bundle: ^5.1
- symfony/console: ^4.0
- symfony/expression-language: ^4.0
- symfony/flex: ^1.0
- symfony/framework-bundle: ^4.0
- symfony/orm-pack: ^1.0
- symfony/security-bundle: ^4.0
- symfony/validator: ^4.0
Requires (Dev)
- behat/behat: ^3.4
- behat/mink: ^1.7.1@dev
- behat/mink-browserkit-driver: @dev
- behat/mink-extension: ^2.3
- behat/symfony2-extension: ^2.1
- behatch/contexts: ^3.1
- doctrine/doctrine-fixtures-bundle: ^3.0
- emuse/behat-html-formatter: ^0.1.0
- friendsofphp/php-cs-fixer: ^2.11
- phpunit/php-code-coverage: ^6.0
- rdx/behat-variables: ^1.2
- symfony/browser-kit: ~4.0
- symfony/dom-crawler: ~4.0
- symfony/dotenv: ^4.0
- symfony/maker-bundle: ^1.4
- symfony/phpunit-bridge: ^4.0
This package is not auto-updated.
Last update: 2022-11-04 13:52:13 UTC
README
This bundle is a base for the CreamIO symfony bundles over Symfony 4.0.
Requirements
- Symfony 4;
- PHP 7.2 or higher;
- Composer;
- MySQL database;
- PDO PHP extension;
- and the usual Symfony application requirements.
Installation
Require the bundle from a symfony 4 application.
You must configure the logger channel to log to database by modifying config/packages/(dev|prod)/monolog.yaml
this way :
channels: ['db'] handlers: db: channels: ['db'] type: service id: cream_io_base.loggingservice
You MUST NOT modify anything in this configuration, as the services are injected in the bundle for logger providing.
Usage
Autowire or inject CreamIO\BaseBundle\Service\LoggerProvider
in your service/controller.
You can then log this way :
$logger = $loggerProvider->logger(); $logger->info('My information to log', ['userId', $user->getId()]);
The second parameter is the context, it can be an array of whatever you want to identify the logging context.
Project tree
. └── src ├── DependencyInjection ├── EventSubscriber # Exception event subscriber ├── Exceptions # APIError and APIException for error handling in API ├── Resources │ └── config # Service injection └── Service # API Service handling JSON responses
License
This software is distributed under the terms of the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International Public License. License is described below, you can find a human-readable summary of (and not a substitute for) the license here.