1 year ago

Change log output filenames at run time

Posted 1 year ago by geoffhouse

Hi. I'm using Laravel 5.7, and I've got a number of classes which are run from the console (using the artisan command). I'd really like each instance of each class to log to a separate file, but using a filename which is set from the class.

I could create loads of log channels in config/logging.php, but that would still only create a log file per class, not per instance. Instead I'd really like to pass the filename in, either in the class constructor or in the actual log command.

Is this possible? Thank you!

Please sign in or create an account to participate in this conversation.