0

If so how can it be done? By default Laravel 4 writes to a text file. I notice that Monolog can Log to Database on its github page. I have tried with this. But rather than storing in database its better to store error log on socket. So can you suggest me according to the socket logging.

Eswara Reddy
  • 1,617
  • 1
  • 18
  • 28

1 Answers1

0

According to Laravel doc and Monolog socket example:

// get Monolog instance
$logger = Log::getMonolog();

// create the socket handler
$handler = new Monolog\Handler\SocketHandler('unix:///var/log/httpd_app_log.socket');
$handler->setPersistent(true);

// now add the handler
$logger->pushHandler($handler, Monolog\Logger::DEBUG);

After register socket handler, you can use Laravel log methods.

aykut
  • 2,984
  • 24
  • 26