mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal.git
synced 2026-08-31 10:24:07 +00:00
29 lines
653 B
PHP
29 lines
653 B
PHP
<?php
|
||
|
||
namespace App\Classes\General;
|
||
|
||
use Illuminate\Support\Facades\Log;
|
||
|
||
class LogHelper
|
||
{
|
||
protected static $channelName;
|
||
|
||
public static function channel($channelName)
|
||
{
|
||
self::$channelName = $channelName;
|
||
return new self;
|
||
}
|
||
|
||
public static function info($message)
|
||
{
|
||
$channelName = self::$channelName;
|
||
Log::info("LogHelper message: {$message}, channelName: {$channelName}");
|
||
if(env('LARAVEL_VAPOR_ENABLED')){
|
||
Log::channel(self::$channelName.'_vapor')->info($message);
|
||
}
|
||
else{
|
||
Log::channel(self::$channelName)->info($message);
|
||
}
|
||
}
|
||
}
|