Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollbar configuration example #86

Open
thefuriouscoder opened this issue Jul 9, 2018 · 0 comments
Open

Rollbar configuration example #86

thefuriouscoder opened this issue Jul 9, 2018 · 0 comments

Comments

@thefuriouscoder
Copy link

Hello,

it is possible to use monolog-cascade to configure the rollbar handler, I would like to configure all handlers using the yml config file, but I don't know if it's possible, even using the dependency config example, now, I'm using the Rollbar handler as follows:

Cascade::fileConfig(__DIR__ . '/config/dev/log.yml');
Rollbar::init([
    'access_token' => 'supercecretaccesstoken',
    'environment' => 'development'
]);
Cascade::getLogger('daemon')->pushHandler(
    new RollbarHandler(Rollbar::logger(), \Monolog\Logger::ERROR)
);

and my config file looks like that:

formatters:
  dashed:
    class: Monolog\Formatter\LineFormatter
    format: "%datetime% - [%level_name%][%extra.process_id%] - %message%\n"
handlers:
  logfile:
    class: Monolog\Handler\StreamHandler
    level: INFO
    formatter: dashed
    processors: [memory_processor,pid_processor]
    stream: /tmp/daemon.log
processors:
  memory_processor:
    class: Monolog\Processor\MemoryUsageProcessor
  pid_processor:
    class: Monolog\Processor\ProcessIdProcessor
loggers:
  daemon:
    handlers: [logfile]

Hope you can help me.

Thanks in advance.
Diego.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant