I want to create a new logfile in Laravel and write some information into. I dont want to use the default logfile because I dont want to mix my new log entries with the system entries.
Something like this:
Log::info('mylogfile.txt', 'Something happened!');
In Laravel >= 5.6 you can use Log Channels. In this way you can create log channels which can be handled as unique log files with drivers, paths and log levels. Edit your config file and add a new channel:
return [ 'channels' => [ 'myLogChannel' => [ 'driver' => 'single', 'path' => storage_path('logs/seperate.log'), 'level' => 'debug', ], ], ];
Now you can use this new driver in this way: