Laravel provides logging services that allow you to log errors, messages, events and uses Monolog, a powerful popular PHP logging library for all its logging needs.
config/logging.php
- emergency,
- alert,
- critical,
- error,
- warning,
- notice,
- info,
- debug.
Illuminate\Support\Facades\Log`
Log::emergency('Log message comes here');
Log::alert('Log message comes here');
Log::critical('Log message comes here');
Log::error('Log message comes here');
Log::warning('Log message comes here');
Log::notice('Log message comes here');
Log::info('Log message comes here');
Log::debug('Log message comes here');
Log::info('Log message with contextual data.', ['name' => $user->name]);
Output:
[2019-03-15 11:17:42] local.INFO: Log message with contextual data. {"name":"John doe"}
Log::channel('slack')->error('Something went wrong');