php-laravelHow can I log information to the console using PHP Laravel?
Logging information to the console using PHP Laravel can be done by using the Log
facade. The Log facade provides various logging levels such as debug
, info
, notice
, warning
, error
, critical
, alert
, and emergency
.
Example code
Log::info('This is an info message');
Output example
[2020-06-30 11:08:56] local.INFO: This is an info message
The code above will output an info message to the console. The code consists of the following parts:
Log
- the facade used to log the message.info
- the logging level.This is an info message
- the message that will be logged.
For more information see the Laravel Logging Documentation.
More of Php Laravel
- How do I set up a Laravel worker using PHP?
- How can I use the "order by" function in PHP Laravel?
- How do I use Enum in Laravel with PHP?
- ¿Cómo configurar PHP y Laravel desde cero?
- How do I set the timezone in PHP Laravel?
- How can I use Laravel Sail to develop a web application with PHP?
- How do I create a controller in Laravel using PHP?
- How do I run a seeder in Laravel using PHP?
- How do I deploy a Laravel application to a Kubernetes cluster using PHP?
- How do I parse JSON data using Laravel and PHP?
See more codes...