public function testLogging() { Log::log('info', 'testing', ['context' => 'context']); $entry = LogModel::first(); $expected = ['id' => '1', 'read' => '0', 'message' => 'testing', 'context' => '{"context":"context"}', 'level' => '200', 'level_name' => 'INFO', 'channel' => 'testing', 'extra' => '[]']; $this->assertEquals($expected, array_only($entry->getAttributes(), array_keys($expected))); }
/** * @param int $level * @param string|array $message * @param array $context * * @return bool */ public function log($level, $message, array $context = []) { Log::log($level, $message, $context); }