use Kaltura\Client\Logging\Log; use Kaltura\Client\Logging\LogLevel; $log = new Log(LogLevel::DEBUG, "debug message"); $log->setModule("MyModule"); $log->setSource("MySource"); KalturaLog::getInstance()->log($log);
use Kaltura\Client\Logging\ExceptionLogger; use Kaltura\Client\Logging\Log; use Kaltura\Client\Logging\LogLevel; $log = new Log(LogLevel::ERROR, "error message"); $log->setModule("MyModule"); $log->setSource("MySource"); $exception = new \Exception("This is an exception"); $logger = ExceptionLogger::getInstance(); $logger->logException($exception, $log);This code creates a new Log object with an error log level and a message, and sets the module and source. It also creates a new Exception object. Then it calls the ExceptionLogger to log both the exception and the error message using KalturaLog. Overall, KalturaLog is a useful PHP library for logging messages and errors in Kaltura server-side applications. It provides a simple interface for logging different log levels and can be used with or without exceptions to provide more detailed error information.