scoutapp / scout-apm-laravel

ScoutAPM PHP Agent for the Laravel Framework
MIT License
22 stars 12 forks source link

Configuration is only from env vars at the moment #27

Closed asgrim closed 4 years ago

asgrim commented 4 years ago

At the moment, only configuration from environment files can be done in Laravel.

The \Scoutapm\Config instantiation is done just with new Config(); make this more configurable if you don't use the env.

asgrim commented 4 years ago

As of ^1.0 you can override the configuration in your own service provider, after \Scoutapm\Laravel\Providers\ScoutApmServiceProvider::register(), for example:

        $this->app->singleton(self::CONFIG_SERVICE_KEY, static function () {
            return Config::fromArray([
                ConfigKey::APPLICATION_NAME => 'My Application Name',
                ConfigKey::APPLICATION_KEY => 'my application key',
                ConfigKey::MONITORING_ENABLED => true,
                ConfigKey::LOG_LEVEL => LogLevel::ERROR,
            ]);
        });