xeonys/logger-extra-library

This package is abandoned and no longer maintained. The author suggests using the inextensodigital/logger-extra-library package instead.
There is no license information available for the latest version (v1.0.0) of this package.

Logger extra useful library

v1.0.0 2016-09-20 13:33 UTC

README

  • Add extra data to logs
  • ELK stack default configuration

Installation

composer.json

    "require": {
        "graylog2/gelf-php": "~1.4",
        "xeonys/logger-extra-library": "~1.0"
    }

AppKernel

$bundles[] = new Xeonys\LoggerExtra\App\Bundle\XeonysLoggerExtraBundle();

config.yml

xeonys_logger_extra:
    fields:
        app_name:     app_name #your application name.
        app_env:      %xeonys.logger_extra.app_env%
        server_stack: %xeonys.logger_extra.server_stack%

config_prod.yml

imports:
    - { resource: config.yml }
    - { resource: "@XeonysLoggerExtraBundle/Resources/config/monolog_gelf.yml" }

parameters.yml

    xeonys.elk.gelf.host: elkdomain.tld
    xeonys.elk.gelf.port: 12201 # in local environment, use a different port, to not polluate elk.
    xeonys.logger_extra.app_env: prod
    xeonys.logger_extra.server_stack: local