itelmenko / laravel-mysql-logger

Laravel 5.6+ MySQL driver for Monolog
19 stars 8 forks source link

Bug: Using env() in the create_logs_table migration. config() should be used instead #4

Closed bdteo closed 4 years ago

bdteo commented 5 years ago

https://stackoverflow.com/questions/40026893/what-is-difference-between-use-envapp-env-configapp-env-or-appenviron

bdteo commented 5 years ago

The worst thing are actually these lines of code

 public function __construct(array $attributes = array())
    {
        $this->table      = env('DB_LOG_TABLE', 'logs');
        $this->connection = env('DB_LOG_CONNECTION', env('DB_CONNECTION', 'mysql'));

        parent::__construct($attributes);
    }

They render the package absolutely unusable in production.

itelmenko commented 4 years ago

Thank you @bdteo for comments! Fixed