17 lines
447 B
PHP
17 lines
447 B
PHP
<?php
|
|
|
|
namespace App;
|
|
|
|
use App\Models\Project;
|
|
use Illuminate\Support\Facades\Storage;
|
|
|
|
class ProjectLogger
|
|
{
|
|
public static function log(Project $project, $message)
|
|
{
|
|
$filePath = $project->download_path . '/logs/' . now()->format('Ymd') . '.log';
|
|
Storage::makeDirectory(dirname($filePath));
|
|
file_put_contents(Storage::path($filePath), now()->format('Y-m-d H:i:s') . ': ' . $message . PHP_EOL, FILE_APPEND);
|
|
}
|
|
}
|