메뉴 건너뛰기

DB접속 로그파일 용량

서버 용량부족으로 보니

DB접속시 쌓이는 로그파일이 11기가였네요

query.log 파일입니다

 

app/프로바이더/데이터베이스서비스프로바이더.php

public function boot()
{
    if ($this->app['config']->get('app.debug') === true) {

        \DB::listen(function (QueryExecuted $executed) {
            $query = $executed->sql;
            $bindings = $executed->bindings;
            $time = $executed->time;
            $logFile = storage_path('logs/query.log');
            $monoLog = new Logger('log');
            $monoLog->pushHandler(new StreamHandler($logFile, Logger::INFO));
            $monoLog->info($query, compact('bindings', 'time'));
        });
    }
    DynamicModel::setKeyGen(app('xe.keygen'));
    DynamicModel::setConnectionResolver($this->app['xe.db']);
    DynamicModel::setEventDispatcher($this->app['events']);

    VirtualConnection::setCache($this->app['cache']->driver('schema'));
}

위 부분에서 어떻게 용량제한을 하였으면 좋을듯합니다.

감사합니다!

  • share