Specify log info to seperate files-Laravel

Log files are always helpful when debugging the project so it is crucial to maintain a proper

log file. The Laravel logging facilities provides a simple layer on top of the mono log library according to

Laravel documentation. Laravel is configured in such a way that it creates a single log file for the

application in app/storage/logs/laravel.log. You can write informations in this log file. For writing a log

file to another location use the useDailyFiles or useFiles methods. Then write info to log to the log file at

the specified path.


Log::info([info to log]);

If the path of the log file doesn’t exist create it and it should be the first parameter. The number of days

can be entered as second parameter i.e. the number of days Laravel will log before erasing old logs. It is

not mandatory since the default value is unlimited.