Ver Fonte

#5015 Logs: add log level

Alex Trofimov há 1 ano atrás
pai
commit
caabe4f30a
43 ficheiros alterados com 156 adições e 151 exclusões
  1. 1 1
      ai/BxDolAI.php
  2. 1 1
      inc/classes/BxDolAI.php
  3. 4 4
      inc/classes/BxDolBackgroundJobs.php
  4. 2 1
      inc/classes/BxDolDb.php
  5. 1 1
      inc/classes/BxDolPushOneSignal.php
  6. 1 1
      inc/classes/BxDolSmsSmsRu.php
  7. 1 1
      inc/classes/BxDolSmsTwilio.php
  8. 1 1
      inc/classes/BxDolSocketsSoketi.php
  9. 3 3
      inc/classes/BxDolStorageS3.php
  10. 3 3
      inc/classes/BxDolStorageS3v4alt.php
  11. 6 3
      inc/classes/BxDolTemplate.php
  12. 25 25
      inc/classes/BxDolTranscoder.php
  13. 1 1
      inc/classes/BxDolTranscoderImage.php
  14. 2 2
      inc/classes/BxDolTranscoderVideo.php
  15. 1 1
      inc/utils.inc.php
  16. 2 2
      modules/base/payment/classes/BxBaseModPaymentModule.php
  17. 2 2
      modules/base/payment/classes/BxBaseModPaymentProvider.php
  18. 1 1
      modules/boonex/ads/classes/BxAdsSource.php
  19. 1 1
      modules/boonex/ads/classes/BxAdsSourceShopifyPartner.php
  20. 2 1
      modules/boonex/dolphin_migration/classes/BxMDb.php
  21. 5 5
      modules/boonex/elasticsearch/classes/BxElsApi.php
  22. 2 2
      modules/boonex/okta_connect/classes/BxOktaConCustom.php
  23. 5 5
      modules/boonex/payment/classes/BxPaymentModule.php
  24. 1 1
      modules/boonex/payment/classes/BxPaymentProviderAppleInApp.php
  25. 12 12
      modules/boonex/payment/classes/BxPaymentProviderChargebee.php
  26. 1 1
      modules/boonex/payment/classes/BxPaymentProviderChargebeeV3.php
  27. 3 3
      modules/boonex/payment/classes/BxPaymentProviderCredits.php
  28. 11 11
      modules/boonex/payment/classes/BxPaymentProviderPayPal.php
  29. 15 15
      modules/boonex/payment/classes/BxPaymentProviderPayPalApi.php
  30. 4 4
      modules/boonex/payment/classes/BxPaymentProviderStripeBasic.php
  31. 2 2
      modules/boonex/payment/classes/BxPaymentProviderStripeConnect.php
  32. 2 2
      modules/boonex/payment/classes/BxPaymentProviderStripeV3.php
  33. 1 1
      modules/boonex/profiler/classes/BxProfiler.php
  34. 1 1
      modules/boonex/smtpmailer/classes/BxSMTPModule.php
  35. 3 3
      modules/boonex/stream/classes/BxStrmEngineOvenMediaEngine.php
  36. 2 2
      modules/boonex/stream/classes/BxStrmModule.php
  37. 1 1
      modules/boonex/stripe_connect/classes/BxStripeConnectApi.php
  38. 1 1
      modules/boonex/stripe_connect/classes/BxStripeConnectModule.php
  39. 1 1
      modules/boonex/timeline/classes/BxTimelineDb.php
  40. 10 10
      modules/boonex/xero/classes/BxXeroApi.php
  41. 3 3
      modules/boonex/xero/classes/BxXeroModule.php
  42. 1 1
      periodic/cron.php
  43. 8 8
      studio/classes/BxDolStudioInstallerUtils.php

+ 1 - 1
ai/BxDolAI.php

@@ -205,7 +205,7 @@ class BxDolAI extends BxDolFactory implements iBxDolSingleton
 
     private function writeLog($sString)
     {
-        bx_log('sys_agents', $sString);
+        bx_log('sys_agents', $sString, BX_LOG_ERR);
     }
 }
 

+ 1 - 1
inc/classes/BxDolAI.php

@@ -409,7 +409,7 @@ class BxDolAI extends BxDolFactory implements iBxDolSingleton
         if(empty($sSection))
             $sSection = "Core";
 
-        bx_log('sys_agents', ":\n[" . $sSection . "] " . $mixedContents);
+        bx_log('sys_agents', ":\n[" . $sSection . "] " . $mixedContents, BX_LOG_ERR);
     }
 
     protected function _evalCode($aAutomator, $aParams = [])

+ 4 - 4
inc/classes/BxDolBackgroundJobs.php

@@ -53,7 +53,7 @@ class BxDolBackgroundJobs  extends BxDolFactory implements iBxDolSingleton
         if(!$this->_oQuery->addJob($sName, $mixedServiceCall, $iPriority))
             return false;
 
-        bx_log($this->_sObjectLog, "Added: " . $sName);
+        bx_log($this->_sObjectLog, "Added: " . $sName, BX_LOG_INFO);
 
         return true;
     }
@@ -63,7 +63,7 @@ class BxDolBackgroundJobs  extends BxDolFactory implements iBxDolSingleton
         if(!$this->_oQuery->deleteJob($sName))
             return false;
 
-        bx_log($this->_sObjectLog, "Deleted: " . $sName);
+        bx_log($this->_sObjectLog, "Deleted: " . $sName, BX_LOG_INFO);
 
         return true;
     }
@@ -99,7 +99,7 @@ class BxDolBackgroundJobs  extends BxDolFactory implements iBxDolSingleton
 
         $this->_oQuery->deleteJob($mixedJob['name']);
 
-        bx_log($this->_sObjectLog, "Processed: " . $mixedJob['name'] . " / timing: " . $fTiming . " / memory: " . memory_get_usage());
+        bx_log($this->_sObjectLog, "Processed: " . $mixedJob['name'] . " / timing: " . $fTiming . " / memory: " . memory_get_usage(), BX_LOG_INFO);
         return true;
     }
 
@@ -114,7 +114,7 @@ class BxDolBackgroundJobs  extends BxDolFactory implements iBxDolSingleton
             if($this->process($aJob))
                 $iProcessed += 1;
 
-        bx_log($this->_sObjectLog, "Processed: all (" . $iProcessed . " from " . count($aJobs) . ")");
+        bx_log($this->_sObjectLog, "Processed: all (" . $iProcessed . " from " . count($aJobs) . ")", BX_LOG_INFO);
 
         return true;
     }

+ 2 - 1
inc/classes/BxDolDb.php

@@ -685,7 +685,8 @@ class BxDolDb extends BxDolFactory implements iBxDolSingleton
             bx_log('sys_db', "$sErrorType\n" . 
                 (empty($aError['message']) ? '' : "  Error: {$aError['message']}\n") . 
                 (empty($aError['query']) ? '' : "  Query: {$aError['query']}\n") . 
-                (!function_exists('getLoggedId') || !getLoggedId() ? '' : "  Account ID: " . getLoggedId() . "\n")
+                (!function_exists('getLoggedId') || !getLoggedId() ? '' : "  Account ID: " . getLoggedId() . "\n"),
+                BX_LOG_ERR
             );
         }
 

+ 1 - 1
inc/classes/BxDolPushOneSignal.php

@@ -108,7 +108,7 @@ class BxDolPushOneSignal extends BxDolPush
         $oResult = @json_decode($sResult, true);
         if(isset($oResult['errors']))
             foreach($oResult['errors'] as $sError) {  
-                bx_log('sys_push', $sError . " Message:" . json_encode($aMessage));
+                bx_log('sys_push', $sError . " Message:" . json_encode($aMessage), BX_LOG_ERR);
             }
 
         return $sResult;

+ 1 - 1
inc/classes/BxDolSmsSmsRu.php

@@ -35,7 +35,7 @@ class BxDolSmsSmsRu extends BxDolSms
         if(($oResult = $oProvider->send_one($oData)) && $oResult->status == "OK")
             return true;
 
-        $this->_writeLog($oResult->status_code . ': ' . $oResult->status_text);
+        $this->_writeLog($oResult->status_code . ': ' . $oResult->status_text, BX_LOG_ERR);
         return false;
     }
 }

+ 1 - 1
inc/classes/BxDolSmsTwilio.php

@@ -36,7 +36,7 @@ class BxDolSmsTwilio extends BxDolSms
             return true;
         }
         catch (Exception $oException) {
-            $this->_writeLog($oException->getFile() . ':' . $oException->getLine() . ' ' . $oException->getMessage());
+            $this->_writeLog($oException->getFile() . ':' . $oException->getLine() . ' ' . $oException->getMessage(), BX_LOG_ERR);
 
             return false;
         }

+ 1 - 1
inc/classes/BxDolSocketsSoketi.php

@@ -37,7 +37,7 @@ class BxDolSocketsSoketi extends BxDolSockets
             $b = $oPusher->trigger($sSocket . '_' . $iContentId, $sEvent, $sMessage);
         }
         catch (Exception $oException) {
-            $this->writeLog($oException->getFile() . ':' . $oException->getLine() . ' ' . $oException->getMessage());
+            $this->writeLog($oException->getFile() . ':' . $oException->getLine() . ' ' . $oException->getMessage(), BX_LOG_ERR);
             return false;
         }
     }

+ 3 - 3
inc/classes/BxDolStorageS3.php

@@ -191,7 +191,7 @@ class BxDolStorageS3 extends BxDolStorage
             }
         } catch (Exception $e) {
             $this->setErrorCode(BX_DOL_STORAGE_ERR_ENGINE_GET);
-            bx_log('sys_storage_s3', $e->getMessage());
+            bx_log('sys_storage_s3', $e->getMessage(), BX_LOG_ERR);
             return false;
         }
 
@@ -236,7 +236,7 @@ class BxDolStorageS3 extends BxDolStorage
             }
         } catch (Exception $e) {
             $this->setErrorCode(BX_DOL_STORAGE_ERR_ENGINE_ADD);
-            bx_log('sys_storage_s3', $e->getMessage());
+            bx_log('sys_storage_s3', $e->getMessage(), BX_LOG_ERR);
             return false;
         }
 
@@ -254,7 +254,7 @@ class BxDolStorageS3 extends BxDolStorage
             }
         } catch (Exception $e) {
             $this->setErrorCode(BX_DOL_STORAGE_ERR_UNLINK);
-            bx_log('sys_storage_s3', $e->getMessage());
+            bx_log('sys_storage_s3', $e->getMessage(), BX_LOG_ERR);
             return false;
         }
 

+ 3 - 3
inc/classes/BxDolStorageS3v4alt.php

@@ -103,7 +103,7 @@ class BxDolStorageS3v4alt extends BxDolStorageS3
         } catch (Exception $e) {
             @unlink($sTmpFile);
             $this->setErrorCode(BX_DOL_STORAGE_ERR_UNLINK);
-            bx_log('sys_storage_s3v4alt', $e->getMessage());
+            bx_log('sys_storage_s3v4alt', $e->getMessage(), BX_LOG_ERR);
             return false;
         }
 
@@ -171,7 +171,7 @@ class BxDolStorageS3v4alt extends BxDolStorageS3
 
         } catch (Exception $e) {
             $this->setErrorCode(BX_DOL_STORAGE_ERR_ENGINE_ADD);
-            bx_log('sys_storage_s3v4alt', $e->getMessage());
+            bx_log('sys_storage_s3v4alt', $e->getMessage(), BX_LOG_ERR);
             return false;
         }
 
@@ -186,7 +186,7 @@ class BxDolStorageS3v4alt extends BxDolStorageS3
             $this->_s3->deleteObject($this->_sBucket, $sFileLocation);
         } catch (Exception $e) {
             $this->setErrorCode(BX_DOL_STORAGE_ERR_UNLINK);
-            bx_log('sys_storage_s3v4alt', $e->getMessage());
+            bx_log('sys_storage_s3v4alt', $e->getMessage(), BX_LOG_ERR);
             return false;
         }
 

+ 6 - 3
inc/classes/BxDolTemplate.php

@@ -3151,7 +3151,8 @@ class BxDolTemplate extends BxDolFactory implements iBxDolSingleton
         catch(Exception $oException) {
             bx_log('sys_template', "Error in _parseContent method. Cannot parse template insertion (<bx_include... />).\n" . 
                 "  Error ({$oException->getCode()}): {$oException->getMessage()}\n" . 
-                (getLoggedId() ? "  Account ID: " . getLoggedId() . "\n" : "")
+                (getLoggedId() ? "  Account ID: " . getLoggedId() . "\n" : ""),
+                BX_LOG_ERR
             );
 
             return '';
@@ -3178,7 +3179,8 @@ class BxDolTemplate extends BxDolFactory implements iBxDolSingleton
         catch(Exception $oException) {
             bx_log('sys_template', "Error in _parseContent method. Cannot parse System Keys.\n" . 
                 "  Error ({$oException->getCode()}): {$oException->getMessage()}\n" . 
-                (getLoggedId() ? "  Account ID: " . getLoggedId() . "\n" : "")
+                (getLoggedId() ? "  Account ID: " . getLoggedId() . "\n" : ""),
+                BX_LOG_ERR
             );
 
             return '';
@@ -3290,7 +3292,8 @@ class BxDolTemplate extends BxDolFactory implements iBxDolSingleton
             if(($iCode = $oException->getCode()) != 1)
                 bx_log('sys_template', "Error in _compileContent method. Cannot parse template insertion (<bx_include... />).\n" . 
                     "  Error ({$iCode}): {$oException->getMessage()}\n" . 
-                    (getLoggedId() ? "  Account ID: " . getLoggedId() . "\n" : "")
+                    (getLoggedId() ? "  Account ID: " . getLoggedId() . "\n" : ""),
+                    BX_LOG_ERR
                 );
 
             return false;

+ 25 - 25
inc/classes/BxDolTranscoder.php

@@ -165,7 +165,7 @@ class BxDolTranscoder extends BxDolFactory implements iBxDolFactoryObject
                 $sFileData = bx_file_get_contents ($aQueue['file_url_result']);
                 if (false === $sFileData) {
                     $o->getDb()->updateQueueStatus($aQueue['file_id_source'], BX_DOL_QUEUE_FAILED, "download file failed: {$aQueue['file_url_result']}\n");
-                    bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: processCompleted failed, get transcoded file from URL ({$aQueue['file_url_result']}) failed");
+                    bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: processCompleted failed, get transcoded file from URL ({$aQueue['file_url_result']}) failed", BX_LOG_ERR);
                     continue;   
                 }
                 
@@ -173,7 +173,7 @@ class BxDolTranscoder extends BxDolFactory implements iBxDolFactoryObject
                 if (!file_put_contents($sTmpFile, $sFileData)) {
                     $o->getDb()->updateQueueStatus($aQueue['file_id_source'], BX_DOL_QUEUE_FAILED, "store downloaded file failed\n");
                     @unlink($sTmpFile);
-                    bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: processCompleted failed, store transcoded file to tmp file ({$sTmpFile}) failed");
+                    bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: processCompleted failed, store transcoded file to tmp file ({$sTmpFile}) failed", BX_LOG_ERR);
                     continue;
                 }
                 
@@ -182,7 +182,7 @@ class BxDolTranscoder extends BxDolFactory implements iBxDolFactoryObject
                    $o->getDb()->updateQueueStatus($aQueue['file_id_source'], BX_DOL_QUEUE_DELETE); // mark to delete it (deletion is performed on the server where it was transcoded)
                 } else {
                     $o->getDb()->updateQueueStatus($aQueue['file_id_source'], BX_DOL_QUEUE_FAILED, "store file failed:\n" . $o->getLog());
-                    bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: processCompleted failed, store transcoded file ({$aQueue['file_id_source']}) in final storage failed: " . $o->getLog());
+                    bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: processCompleted failed, store transcoded file ({$aQueue['file_id_source']}) in final storage failed: " . $o->getLog(), BX_LOG_ERR);
                 }
 
                 // delete tmp local file
@@ -290,14 +290,14 @@ class BxDolTranscoder extends BxDolFactory implements iBxDolFactoryObject
         // delete main file
         $iFileId = $this->_oDb->getFileIdByHandler($mixedHandler);
         if ($iFileId && !$this->_oStorage->deleteFile($iFileId)) {
-            bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: onDeleteFileOrig failed for handler ({$mixedHandler}) delete failed");
+            bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: onDeleteFileOrig failed for handler ({$mixedHandler}) delete failed", BX_LOG_ERR);
             return false;
         }
 
         // delete retina file
         $iFileId = $this->_oDb->getFileIdByHandler($mixedHandler . $this->_sRetinaSuffix);
         if ($iFileId && !$this->_oStorage->deleteFile($iFileId)) {
-            bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: onDeleteFileOrig failed for handler ({$mixedHandler}) delete retina file failed");
+            bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: onDeleteFileOrig failed for handler ({$mixedHandler}) delete retina file failed", BX_LOG_ERR);
             return false;
         }
 
@@ -376,13 +376,13 @@ class BxDolTranscoder extends BxDolFactory implements iBxDolFactoryObject
 
             $iFileId = $this->_oDb->getFileIdByHandler($mixedHandler);
             if (!$iFileId) {
-                bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: getFileUrl failed for handler ({$mixedHandler}) source file id wasn't found");
+                bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: getFileUrl failed for handler ({$mixedHandler}) source file id wasn't found", BX_LOG_ERR);
                 return false;
             }
 
             $aFile = $this->_oStorage->getFile($iFileId);
             if (!$aFile) {
-                bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: getFileUrl failed for handler ({$mixedHandler}) source file wasn't found in the source storage");
+                bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: getFileUrl failed for handler ({$mixedHandler}) source file wasn't found in the source storage", BX_LOG_ERR);
                 return false;
             }
 
@@ -393,7 +393,7 @@ class BxDolTranscoder extends BxDolFactory implements iBxDolFactoryObject
         }
 
         if ($this->_sQueueTable && !$this->addToQueue($mixedHandler)) { // add file to queue (when queue is enabled) if it isn't transcoded yet
-            bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: getFileUrl failed for handler ({$mixedHandler}), can't add file to queue");
+            bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: getFileUrl failed for handler ({$mixedHandler}), can't add file to queue", BX_LOG_ERR);
             return false;
         }
 
@@ -645,7 +645,7 @@ class BxDolTranscoder extends BxDolFactory implements iBxDolFactoryObject
             $oStorage = BxDolStorage::getObjectInstance($this->_sQueueStorage);
             if (!$oStorage->deleteFile($a['file_id_result'])) {
                 $this->_oDb->updateQueueStatus($mixedHandler, BX_DOL_QUEUE_FAILED, $sErrMsg . $this->getLog());
-                bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: deleteFromQueue failed for handler ({$mixedHandler}): " . $this->getLog());
+                bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: deleteFromQueue failed for handler ({$mixedHandler}): " . $this->getLog(), BX_LOG_ERR);
                 return false;
             }
         }
@@ -660,7 +660,7 @@ class BxDolTranscoder extends BxDolFactory implements iBxDolFactoryObject
         $iFileId = $this->_oStorage->storeFileFromPath ($sTmpFile, $isPrivate, $iProfileId);
         if (!$iFileId) {
             $this->addToLog($this->_oStorage->getErrorString());
-            bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: storeTranscodedFile failed for handler ({$mixedHandler}): " . $this->_oStorage->getErrorString());
+            bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: storeTranscodedFile failed for handler ({$mixedHandler}): " . $this->_oStorage->getErrorString(), BX_LOG_ERR);
             return false;
         }
 
@@ -684,7 +684,7 @@ class BxDolTranscoder extends BxDolFactory implements iBxDolFactoryObject
         $iFileIdResult = $oStorage->storeFileFromPath ($sTmpFile, 1, 0);
         if (!$iFileIdResult) {
             $this->addToLog($oStorage->getErrorString());
-            bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: storeTranscodedFileInQueueStorage failed for handler ({$mixedHandler}): " . $oStorage->getErrorString());
+            bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: storeTranscodedFileInQueueStorage failed for handler ({$mixedHandler}): " . $oStorage->getErrorString(), BX_LOG_ERR);
             return false;
         }
 
@@ -723,7 +723,7 @@ class BxDolTranscoder extends BxDolFactory implements iBxDolFactoryObject
         if (IMAGE_ERROR_SUCCESS == $o->resize($sFile))
             return true;
 
-        bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: applyFilter_Resize failed for file ({$sFile}): " . $o->getError());
+        bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: applyFilter_Resize failed for file ({$sFile}): " . $o->getError(), BX_LOG_ERR);
 
         return false;
     }
@@ -809,7 +809,7 @@ class BxDolTranscoder extends BxDolFactory implements iBxDolFactoryObject
             $sPath = BX_DIRECTORY_PATH_ROOT . $sPath;
 
         if (!file_exists($sPath)) {
-            bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: getFilePath_Folder failed, file ({$sPath}) doesn't exist for handler ({$mixedHandler})");
+            bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: getFilePath_Folder failed, file ({$sPath}) doesn't exist for handler ({$mixedHandler})", BX_LOG_ERR);
             return false;
         }
 
@@ -820,13 +820,13 @@ class BxDolTranscoder extends BxDolFactory implements iBxDolFactoryObject
     {
         $sPath = $this->getFilePath_Folder($mixedHandler);
         if (!$sPath) {
-            bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: storeFileLocally_Folder failed, source file ({$sPath}) doesn't exist for handler ({$mixedHandler})");
+            bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: storeFileLocally_Folder failed, source file ({$sPath}) doesn't exist for handler ({$mixedHandler})", BX_LOG_ERR);
             return false;
         }
 
         $sTmpFile = $this->getTmpFilename ($mixedHandler);
         if (!copy($sPath, $sTmpFile)) {
-            bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: storeFileLocally_Folder failed, copy from file ({$sPath}) to file ({$sTmpFile}) failed");
+            bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: storeFileLocally_Folder failed, copy from file ({$sPath}) to file ({$sTmpFile}) failed", BX_LOG_ERR);
             return false;
         }
 
@@ -837,31 +837,31 @@ class BxDolTranscoder extends BxDolFactory implements iBxDolFactoryObject
     {
         $oStorageOriginal = BxDolStorage::getObjectInstance($this->_aObject['source_params']['object']);
         if (!$oStorageOriginal) {
-            bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: storeFileLocally_Storage failed, source storage({$this->_aObject['source_params']['object']}) isn't available");
+            bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: storeFileLocally_Storage failed, source storage({$this->_aObject['source_params']['object']}) isn't available", BX_LOG_ERR);
             return false;
         }
 
         $aFile = $oStorageOriginal->getFile($mixedHandler);
         if (!$aFile) {
-            bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: storeFileLocally_Storage failed, file({$mixedHandler}) wasn't found in source storage ({$this->_aObject['source_params']['object']})");
+            bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: storeFileLocally_Storage failed, file({$mixedHandler}) wasn't found in source storage ({$this->_aObject['source_params']['object']})", BX_LOG_ERR);
             return false;
         }
 
         $sUrl = $oStorageOriginal->getFileUrlById($mixedHandler);
         if (!$sUrl) {
-            bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: storeFileLocally_Storage failed, file({$mixedHandler}) wasn't found in source storage ({$this->_aObject['source_params']['object']})");
+            bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: storeFileLocally_Storage failed, file({$mixedHandler}) wasn't found in source storage ({$this->_aObject['source_params']['object']})", BX_LOG_ERR);
             return false;
         }
 
         $sFileData = bx_file_get_contents ($sUrl, [], 'get', []);
         if (false === $sFileData) {
-            bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: storeFileLocally_Storage failed, getting file from URL({$sUrl}) failed");
+            bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: storeFileLocally_Storage failed, getting file from URL({$sUrl}) failed", BX_LOG_ERR);
             return false;
         }
 
         $sTmpFile = $this->getTmpFilename ($aFile['file_name']);
         if (!file_put_contents($sTmpFile, $sFileData)) {
-            bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: storeFileLocally_Storage failed, file save failed ({$sTmpFile})");
+            bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: storeFileLocally_Storage failed, file save failed ({$sTmpFile})", BX_LOG_ERR);
             return false;
         }
 
@@ -872,19 +872,19 @@ class BxDolTranscoder extends BxDolFactory implements iBxDolFactoryObject
     {   
         $aQueue = $this->_oDb->getFromQueue($mixedHandler);
         if (!$aQueue || !$aQueue['file_url_source']) {
-            bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: storeFileLocally_Queue failed, file ({$mixedHandler}) wasn't found in queue");
+            bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: storeFileLocally_Queue failed, file ({$mixedHandler}) wasn't found in queue", BX_LOG_ERR);
             return false;
         }
 
         $sFileData = bx_file_get_contents ($aQueue['file_url_source'], [], 'get', []);
         if (false === $sFileData) {
-            bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: storeFileLocally_Queue failed, getting file from URL({$aQueue['file_url_source']}) failed");
+            bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: storeFileLocally_Queue failed, getting file from URL({$aQueue['file_url_source']}) failed", BX_LOG_ERR);
             return false;
         }
 
         $sTmpFile = $this->getTmpFilename ($mixedHandler);
         if (!file_put_contents($sTmpFile, $sFileData)) {
-            bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: storeFileLocally_Queue failed, file save failed ({$sTmpFile})");
+            bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: storeFileLocally_Queue failed, file save failed ({$sTmpFile})", BX_LOG_ERR);
             return false;
         }
 
@@ -895,7 +895,7 @@ class BxDolTranscoder extends BxDolFactory implements iBxDolFactoryObject
     {
         $sPath = $this->_aObject['source_params']['path'] . $mixedHandler;
         if (!file_exists(BX_DIRECTORY_PATH_ROOT . $sPath)) {
-            bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: getOrigFileUrl_Folder failed, source file ({$sPath}) doesn't exist");
+            bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: getOrigFileUrl_Folder failed, source file ({$sPath}) doesn't exist", BX_LOG_ERR);
             return false;
         }
         
@@ -906,7 +906,7 @@ class BxDolTranscoder extends BxDolFactory implements iBxDolFactoryObject
     {
         $oStorageOriginal = BxDolStorage::getObjectInstance($this->_aObject['source_params']['object']);
         if (!$oStorageOriginal) {
-            bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: getOrigFileUrl_Storage failed, source storage ({$this->_aObject['source_params']['object']}) doesn't exist");
+            bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: getOrigFileUrl_Storage failed, source storage ({$this->_aObject['source_params']['object']}) doesn't exist", BX_LOG_ERR);
             return false;
         }
 

+ 1 - 1
inc/classes/BxDolTranscoderImage.php

@@ -202,7 +202,7 @@ class BxDolTranscoderImage extends BxDolTranscoder implements iBxDolFactoryObjec
         if (IMAGE_ERROR_SUCCESS == $o->grayscale($sFile))
             return true;
 
-        bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: applyFilter_Grayscale failed for file ({$sFile}): " . $o->getError());
+        bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: applyFilter_Grayscale failed for file ({$sFile}): " . $o->getError(), BX_LOG_ERR);
 
         return false;
     }

+ 2 - 2
inc/classes/BxDolTranscoderVideo.php

@@ -226,12 +226,12 @@ class BxDolTranscoderVideo extends BxDolTranscoder implements iBxDolFactoryObjec
         $this->addToLog("\n---\n{$sCommand}\n{$sOutput}\n");
 
         if (!file_exists($sFileOut) || 0 == filesize($sFileOut)) {
-            bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: _convertVideo failed for file ({$sFile}):\n{$sCommand}\n{$sOutput}\n");
+            bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: _convertVideo failed for file ({$sFile}):\n{$sCommand}\n{$sOutput}\n", BX_LOG_ERR);
             return false;
         }
 
         if ($bRename && !rename($sFileOut, $sFile)) { // rename tmp file, if tmp file was generated
-            bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: _convertVideo failed, final rename from {$sFileOut} to {$sFile} failed");
+            bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: _convertVideo failed, final rename from {$sFileOut} to {$sFile} failed", BX_LOG_ERR);
             return false;
         }
 

+ 1 - 1
inc/utils.inc.php

@@ -2478,7 +2478,7 @@ function bx_get_device_pixel_ratio()
 function bx_log($sObject, $mixed, $iLevel = BX_LOG_DEBUG)
 {
     if (class_exists('BxDolLogs', true) && $o = BxDolLogs::getObjectInstance($sObject))
-        return $o->add($mixed);
+        return $o->add($mixed, $iLevel);
     else
         return false;
 }

+ 2 - 2
modules/base/payment/classes/BxBaseModPaymentModule.php

@@ -437,7 +437,7 @@ class BxBaseModPaymentModule extends BxBaseModGeneralModule
     	return BxDolService::call($mixedModule, 'cancel_subscription_item', $aParams);
     }
 
-    public function log($mixedContents, $sSection = '', $sTitle = '')
+    public function log($mixedContents, $sSection = '', $sTitle = '', $iLevel = BX_LOG_DEBUG)
     {
         if(is_array($mixedContents))
             $mixedContents = var_export($mixedContents, true);	
@@ -449,7 +449,7 @@ class BxBaseModPaymentModule extends BxBaseModGeneralModule
 
         $sTitle .= "\n";
 
-        bx_log('sys_payments', ":\n[" . $sSection . "] " . $sTitle . $mixedContents);
+        bx_log('sys_payments', ":\n[" . $sSection . "] " . $sTitle . $mixedContents, $iLevel);
     }
 }
 

+ 2 - 2
modules/base/payment/classes/BxBaseModPaymentProvider.php

@@ -195,9 +195,9 @@ class BxBaseModPaymentProvider extends BxDol
      * @throws Exception $e 
      *
      */
-    protected function log($mixedContents, $sTitle = '')
+    protected function log($mixedContents, $sTitle = '', $iLevel = BX_LOG_DEBUG)
     {
-        $this->_oModule->log($mixedContents, $this->_sName, $sTitle);
+        $this->_oModule->log($mixedContents, $this->_sName, $sTitle, $iLevel);
     }
 }
 

+ 1 - 1
modules/boonex/ads/classes/BxAdsSource.php

@@ -81,7 +81,7 @@ class BxAdsSource extends BxDol
     protected function _log($sMessage, $bUseLog = false)
     {
         if($bUseLog) {
-            //TODO: Use bx_log here.
+            //TODO: Use bx_log here with ERROR level
         }
         else
             throw new Exception($sMessage);

+ 1 - 1
modules/boonex/ads/classes/BxAdsSourceShopifyPartner.php

@@ -189,7 +189,7 @@ class BxAdsSourceShopifyPartner extends BxAdsSource
     protected function _log($sMessage, $bUseLog = false)
     {
         if($bUseLog) {
-            //TODO: Use bx_log here.
+            //TODO: Use bx_log here with ERROR log level
         }
         else
             throw new Exception($sMessage);

+ 2 - 1
modules/boonex/dolphin_migration/classes/BxMDb.php

@@ -109,7 +109,8 @@ class BxMDb
         bx_log('sys_db', "$sErrorType\n" .
             (empty($aError['message']) ? '' : "  Error: {$aError['message']}\n") .
             (empty($aError['query']) ? '' : "  Query: {$aError['query']}\n") .
-            (!function_exists('getLoggedId') || !getLoggedId() ? '' : "  Account ID: " . getLoggedId() . "\n")
+            (!function_exists('getLoggedId') || !getLoggedId() ? '' : "  Account ID: " . getLoggedId() . "\n"),
+            BX_LOG_ERR
         );
 
         bx_show_service_unavailable_error_and_exit($sOutput);

+ 5 - 5
modules/boonex/elasticsearch/classes/BxElsApi.php

@@ -42,7 +42,7 @@ class BxElsApi extends BxDol
             return $this->api($sQuery, array('query' => array('simple_query_string' => array('query' => $sTerm))));
         } 
         else {
-            $this->log('ERROR: searchSimple - search without specifying particular module(type) isn\'t supported');
+            $this->log('ERROR: searchSimple - search without specifying particular module(type) isn\'t supported', '', BX_LOG_ERR);
         }
     }
 
@@ -58,7 +58,7 @@ class BxElsApi extends BxDol
             return $this->api($sQuery, $aQuery);
         }
         else {
-            $this->log('ERROR: searchExtended - search without specifying particular module(type) isn\'t supported');
+            $this->log('ERROR: searchExtended - search without specifying particular module(type) isn\'t supported', BX_LOG_ERR);
         }
     }
 
@@ -174,7 +174,7 @@ class BxElsApi extends BxDol
         $sHttpCode = 200;
         $s = $this->curl($sUrl, $aData, $sMetod, $sHttpCode);
 
-        $this->log($s);
+        $this->log($s, '', BX_LOG_DEBUG);
 
         if ($sHttpCode >= 300 || $sHttpCode < 200) {
             $this->_sError = 'Action('.$sAction.') returned status - ' . $sHttpCode;
@@ -234,7 +234,7 @@ class BxElsApi extends BxDol
         return $sResult;
     }
 
-    protected function log ($mixed, $sProvider = '')
+    protected function log ($mixed, $sProvider = '', $iLevel = BX_LOG_ERR)
     {
         if (!defined('BX_ELASTICSEARCH_LOG') || !constant('BX_ELASTICSEARCH_LOG'))
             return;
@@ -244,7 +244,7 @@ class BxElsApi extends BxDol
 		else if (is_object($mixed))
 			$mixed = json_encode($mixed);
 		
-		bx_log('bx_elasticsearch', $mixed);
+		bx_log('bx_elasticsearch', $mixed, $iLevel);
     }
 }
 

+ 2 - 2
modules/boonex/okta_connect/classes/BxOktaConCustom.php

@@ -21,7 +21,7 @@ class BxOktaConCustom
 
     function onRegister ($iProfileId, $aRemoteProfileInfo)
     {
-        bx_log('bx_oktacon', $aRemoteProfileInfo);
+        bx_log('bx_oktacon', $aRemoteProfileInfo, BX_LOG_DEBUG);
         
         if (!empty($aRemoteProfileInfo['communities']))
            $this->syncCommunities($iProfileId, explode(',', $aRemoteProfileInfo['communities']));
@@ -31,7 +31,7 @@ class BxOktaConCustom
 
     function onLogin ($oProfile, $aRemoteProfileInfo)
     {
-        bx_log('bx_oktacon', $aRemoteProfileInfo);
+        bx_log('bx_oktacon', $aRemoteProfileInfo, BX_LOG_DEBUG);
 
         if (!empty($aRemoteProfileInfo['communities']))
            $this->syncCommunities($oProfile ? $oProfile->id() : bx_get_logged_profile_id(), explode(',', $aRemoteProfileInfo['communities']));

+ 5 - 5
modules/boonex/payment/classes/BxPaymentModule.php

@@ -1628,13 +1628,13 @@ class BxPaymentModule extends BxBaseModPaymentModule
         foreach($aSubscriptions as $aSubscription) {
             $aPending = $this->_oDb->getOrderPending(array('type' => 'id', 'id' => (int)$aSubscription['pending_id']));
             if(empty($aPending) || !is_array($aPending) || $aPending['type'] != BX_PAYMENT_TYPE_RECURRING) {
-                $this->log($aSubscription, 'Time Tracker', 'Cannot process subscription.');
+                $this->log($aSubscription, 'Time Tracker', 'Cannot process subscription.', BX_LOG_ERR);
                 continue;
             }
 
             $oProvider = $this->getObjectProvider($aPending['provider'], $aPending['seller_id']);
             if($oProvider === false || !$oProvider->isActive() || !method_exists($oProvider, 'makePayment')) {
-                $this->log($aSubscription, 'Time Tracker', 'Payment provider unavailable or incorrect.');
+                $this->log($aSubscription, 'Time Tracker', 'Payment provider unavailable or incorrect.', BX_LOG_ERR);
                 continue;
             }
 
@@ -1643,17 +1643,17 @@ class BxPaymentModule extends BxBaseModPaymentModule
             if(($mixedResult = $oProvider->makePayment($aPending)) !== true) {
                 $this->_oDb->updateSubscription(['status' => BX_PAYMENT_SBS_STATUS_UNPAID], ['id' => $aSubscription['id']]);
 
-                $this->log($aSubscription, 'Time Tracker', 'Payment cannot be processed (code: ' . (!empty($mixedResult['code']) ? (int)$mixedResult['code'] : 0) . ').');
+                $this->log($aSubscription, 'Time Tracker', 'Payment cannot be processed (code: ' . (!empty($mixedResult['code']) ? (int)$mixedResult['code'] : 0) . ').', BX_LOG_ERR);
                 continue;
             }
 
             if(!$this->getObjectSubscriptions()->prolong($aPending)) {
-                $this->log($aSubscription, 'Time Tracker', 'Cannot prolong subscription.');
+                $this->log($aSubscription, 'Time Tracker', 'Cannot prolong subscription.', BX_LOG_ERR);
                 continue;
             }
 
             if(!$this->registerPayment($aPending)) {
-                $this->log($aSubscription, 'Time Tracker', 'Cannot register payment.');
+                $this->log($aSubscription, 'Time Tracker', 'Cannot register payment.', BX_LOG_ERR);
                 continue;
             }
         }

+ 1 - 1
modules/boonex/payment/classes/BxPaymentProviderAppleInApp.php

@@ -73,7 +73,7 @@ class BxPaymentProviderAppleInApp extends BxBaseModPaymentProvider implements iB
         if(!in_array($sType, array('INITIAL_BUY_CUSTOM', 'DID_RENEW', 'REFUND', 'CANCEL')))
             return 200;
 
-        $this->log($aNotification, 'Webhooks: ' . (!empty($sType) ? $sType : ''));
+        $this->log($aNotification, 'Webhooks: ' . (!empty($sType) ? $sType : ''), BX_LOG_INFO);
 
         $sMethod = '_processNotification' . bx_gen_method_name(strtolower($sType), array('.', '_', '-'));
     	if(!method_exists($this, $sMethod))

+ 12 - 12
modules/boonex/payment/classes/BxPaymentProviderChargebee.php

@@ -157,7 +157,7 @@ class BxPaymentProviderChargebee extends BxBaseModPaymentProvider implements iBx
             $iError = $oException->getCode();
             $sError = $oException->getMessage();
 
-            $this->log('Create Hosted Page Error: ' . $sError . '(' . $iError . ')');
+            $this->log('Create Hosted Page Error: ' . $sError . '(' . $iError . ')', '', BX_LOG_ERR);
 
             return false;
         }
@@ -198,7 +198,7 @@ class BxPaymentProviderChargebee extends BxBaseModPaymentProvider implements iBx
             $iError = $oException->getCode();
             $sError = $oException->getMessage();
 
-            $this->log('Create Hosted Page Error: ' . $sError . '(' . $iError . ')');
+            $this->log('Create Hosted Page Error: ' . $sError . '(' . $iError . ')', '', BX_LOG_ERR);
 
             return false;
         }
@@ -220,7 +220,7 @@ class BxPaymentProviderChargebee extends BxBaseModPaymentProvider implements iBx
             $iError = $oException->getCode();
             $sError = $oException->getMessage();
 
-            $this->log('Retrieve Hosted Page Error: ' . $sError . '(' . $iError . ')');
+            $this->log('Retrieve Hosted Page Error: ' . $sError . '(' . $iError . ')', '', BX_LOG_ERR);
 
             return false;
         }
@@ -244,7 +244,7 @@ class BxPaymentProviderChargebee extends BxBaseModPaymentProvider implements iBx
             $iError = $oException->getCode();
             $sError = $oException->getMessage();
 
-            $this->log('Retrieve Subscription Error: ' . $sError . '(' . $iError . ')');
+            $this->log('Retrieve Subscription Error: ' . $sError . '(' . $iError . ')', '', BX_LOG_ERR);
 
             return false;
         }
@@ -285,8 +285,8 @@ class BxPaymentProviderChargebee extends BxBaseModPaymentProvider implements iBx
         catch (Exception $oException) {
             $aError = $oException->getJsonBody();
 
-            $this->log('Delete Subscription Error: ' . $aError['error']['message']);
-            $this->log($aError);
+            $this->log('Delete Subscription Error: ' . $aError['error']['message'], '', BX_LOG_ERR);
+            $this->log($aError, '', BX_LOG_ERR);
 
             return false;
         }
@@ -312,7 +312,7 @@ class BxPaymentProviderChargebee extends BxBaseModPaymentProvider implements iBx
             $iError = $oException->getCode();
             $sError = $oException->getMessage();
 
-            $this->log('Retrieve Invoice Error: ' . $sError . '(' . $iError . ')');
+            $this->log('Retrieve Invoice Error: ' . $sError . '(' . $iError . ')', '', BX_LOG_ERR);
 
             return false;
         }
@@ -341,7 +341,7 @@ class BxPaymentProviderChargebee extends BxBaseModPaymentProvider implements iBx
             $iError = $oException->getCode();
             $sError = $oException->getMessage();
 
-            $this->log('Retrieve Addons Error: ' . $sError . '(' . $iError . ')');
+            $this->log('Retrieve Addons Error: ' . $sError . '(' . $iError . ')', '', BX_LOG_ERR);
 
             return false;
         }
@@ -378,7 +378,7 @@ class BxPaymentProviderChargebee extends BxBaseModPaymentProvider implements iBx
             $iError = $oException->getCode();
             $sError = $oException->getMessage();
 
-            $this->log('Retrieve Addon Error: ' . $sError . '(' . $iError . ')');
+            $this->log('Retrieve Addon Error: ' . $sError . '(' . $iError . ')', '', BX_LOG_ERR);
 
             return false;
         }
@@ -411,7 +411,7 @@ class BxPaymentProviderChargebee extends BxBaseModPaymentProvider implements iBx
             $iError = $oException->getCode();
             $sError = $oException->getMessage();
 
-            $this->log('Retrieve Customer Error: ' . $sError . '(' . $iError . ')');
+            $this->log('Retrieve Customer Error: ' . $sError . '(' . $iError . ')', '', BX_LOG_ERR);
 
             return false;
         }
@@ -467,8 +467,8 @@ class BxPaymentProviderChargebee extends BxBaseModPaymentProvider implements iBx
         if(!in_array($sType, array('payment_succeeded', ' payment_refunded', 'subscription_cancelled')))
             return 200;
 
-        $this->log('Webhooks: ' . (!empty($sType) ? $sType : ''));
-        $this->log($aEvent);
+        $this->log('Webhooks: ' . (!empty($sType) ? $sType : ''), '', BX_LOG_INFO);
+        $this->log($aEvent, '', BX_LOG_INFO);
 
         $sMethod = '_processEvent' . bx_gen_method_name($sType, array('.', '_', '-'));
         if(!method_exists($this, $sMethod))

+ 1 - 1
modules/boonex/payment/classes/BxPaymentProviderChargebeeV3.php

@@ -283,7 +283,7 @@ class BxPaymentProviderChargebeeV3 extends BxPaymentProviderChargebee
             $iError = $oException->getCode();
             $sError = $oException->getMessage();
 
-            $this->log('Get Portal Error: ' . $sError . '(' . $iError . ')');
+            $this->log('Get Portal Error: ' . $sError . '(' . $iError . ')', '', BX_LOG_ERR);
 
             return false;
     	}

+ 3 - 3
modules/boonex/payment/classes/BxPaymentProviderCredits.php

@@ -95,9 +95,9 @@ class BxPaymentProviderCredits extends BxBaseModPaymentProvider implements iBxBa
     {
         $aResult = $this->_finalizeCheckout($aData);
         if((int)$aResult['code'] != BX_PAYMENT_RESULT_SUCCESS) {
-            $this->log('Finalize Checkout: Failed');
-            $this->log($aData);
-            $this->log($aResult);
+            $this->log('Finalize Checkout: Failed', '', BX_LOG_ERR);
+            $this->log($aData, '', BX_LOG_ERR);
+            $this->log($aResult, '', BX_LOG_ERR);
         }
 
         if(!empty($aResult['pending_id']))

+ 11 - 11
modules/boonex/payment/classes/BxPaymentProviderPayPal.php

@@ -100,8 +100,8 @@ class BxPaymentProviderPayPal extends BxBaseModPaymentProvider implements iBxBas
                 break;
         }
 
-        $this->log('Initialize Checkout:');
-        $this->log($aFormData);
+        $this->log('Initialize Checkout:', '', BX_LOG_INFO);
+        $this->log($aFormData, '', BX_LOG_INFO);
 
         $this->_oModule->_oTemplate->displayPageCodeRedirect($sActionURL, $aFormData);
         exit;
@@ -111,9 +111,9 @@ class BxPaymentProviderPayPal extends BxBaseModPaymentProvider implements iBxBas
     {
         $aResult = $this->_registerCheckout($aData);
         if(!isset($aResult['code']) || (int)$aResult['code'] != BX_PAYMENT_RESULT_SUCCESS) {
-            $this->log('Finalize Checkout: Failed');
-            $this->log($aData);
-            $this->log($aResult);
+            $this->log('Finalize Checkout: Failed', '', BX_LOG_ERR);
+            $this->log($aData, '', BX_LOG_ERR);
+            $this->log($aResult, '', BX_LOG_ERR);
         }
 
         return $aResult;
@@ -247,8 +247,8 @@ class BxPaymentProviderPayPal extends BxBaseModPaymentProvider implements iBxBas
 
     protected function _readValidationData($sConnectionUrl, $sRequest)
     {
-        $this->log('Validation Request: ');
-        $this->log($sRequest);
+        $this->log('Validation Request: ', '', BX_LOG_INFO);
+        $this->log($sRequest, '', BX_LOG_INFO);
 
 		$rConnect = curl_init('https://' . $sConnectionUrl . '/cgi-bin/webscr');
 		curl_setopt($rConnect, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
@@ -267,8 +267,8 @@ class BxPaymentProviderPayPal extends BxBaseModPaymentProvider implements iBxBas
         }
 
 		if(!$sResponse) {
-		    $this->log('Validation Data: ' . curl_error($rConnect));
-            $this->log($sResponse);
+		    $this->log('Validation Data: ' . curl_error($rConnect), '', BX_LOG_ERR);
+            $this->log($sResponse, '', BX_LOG_ERR);
 			curl_close($rConnect);
 
 			return array('code' => 5, 'message' => $this->_sLangsPrefix . 'err_cannot_validate');
@@ -278,8 +278,8 @@ class BxPaymentProviderPayPal extends BxBaseModPaymentProvider implements iBxBas
 
 		$aResponse = explode("\n", $sResponse);
 
-		$this->log('Validation Response: ');
-        $this->log($aResponse);
+		$this->log('Validation Response: ', '', BX_LOG_INFO);
+        $this->log($aResponse, '', BX_LOG_INFO);
 		return array('code' => 0, 'content' => $aResponse);
     }
 

+ 15 - 15
modules/boonex/payment/classes/BxPaymentProviderPayPalApi.php

@@ -181,8 +181,8 @@ class BxPaymentProviderPayPalApi extends BxBaseModPaymentProvider implements iBx
 
         $aResult = $this->$sMethod($aData);
         if(!isset($aResult['code']) || (int)$aResult['code'] != BX_PAYMENT_RESULT_SUCCESS) {
-            $this->log($aResult, 'Finalize Checkout Failed:');
-            $this->log($aData, 'Finalize Checkout Input:');
+            $this->log($aResult, 'Finalize Checkout Failed:', BX_LOG_ERR);
+            $this->log($aData, 'Finalize Checkout Input:', BX_LOG_ERR);
         }
 
         return $aResult;
@@ -361,8 +361,8 @@ class BxPaymentProviderPayPalApi extends BxBaseModPaymentProvider implements iBx
         ));
 
         if($mixedResult === false || empty($mixedResult['id']) || empty($mixedResult['links'])) {
-            $this->log($mixedResult, 'Create Subscription:');
-
+            $this->log($mixedResult, 'Create Subscription:', BX_LOG_ERR);
+            
             return $this->_sLangsPrefix . 'err_cannot_perform';
         }
 
@@ -383,7 +383,7 @@ class BxPaymentProviderPayPalApi extends BxBaseModPaymentProvider implements iBx
     {
         $mixedResult = $this->_apiCallAuthorized($this->_sEndpoint . 'v1/billing/subscriptions/' . $sSubscriptionId, array(), array(), 'get');
         if($mixedResult === false || !isset($mixedResult['id'])) {
-            $this->log($mixedResult, 'Get Subscription:');
+            $this->log($mixedResult, 'Get Subscription:', BX_LOG_ERR);
 
             return array();
         }
@@ -398,7 +398,7 @@ class BxPaymentProviderPayPalApi extends BxBaseModPaymentProvider implements iBx
         ], [], 'post-json', true);
 
         if($sCode != 204) {
-            $this->log($sResponse, 'Cancel Subscription:');
+            $this->log($sResponse, 'Cancel Subscription:', BX_LOG_ERR);
 
             return false;
         }
@@ -423,7 +423,7 @@ class BxPaymentProviderPayPalApi extends BxBaseModPaymentProvider implements iBx
         ));
 
         if($mixedResult === false || !isset($mixedResult['id'])) {
-            $this->log($mixedResult, 'Create Product:');
+            $this->log($mixedResult, 'Create Product:', BX_LOG_ERR);
 
             return false;
         }
@@ -435,7 +435,7 @@ class BxPaymentProviderPayPalApi extends BxBaseModPaymentProvider implements iBx
     {
         $mixedResult = $this->_apiCallAuthorized($this->_sEndpoint . 'v1/catalogs/products/' . $sProductId, array(), array(), 'get');
         if($mixedResult === false || !isset($mixedResult['id'])) {
-            $this->log($mixedResult, 'Get Product:');
+            $this->log($mixedResult, 'Get Product:', BX_LOG_ERR);
 
             return array();
         }
@@ -509,7 +509,7 @@ class BxPaymentProviderPayPalApi extends BxBaseModPaymentProvider implements iBx
         ));
 
         if($mixedResult === false || !isset($mixedResult['id'])) {
-            $this->log($mixedResult, 'Create Plan:');
+            $this->log($mixedResult, 'Create Plan:', BX_LOG_ERR);
 
             return false;
         }
@@ -521,7 +521,7 @@ class BxPaymentProviderPayPalApi extends BxBaseModPaymentProvider implements iBx
     {
         $mixedResult = $this->_apiCallAuthorized($this->_sEndpoint . 'v1/billing/plans/' . $sPlanId, array(), array(), 'get');
         if($mixedResult === false || !isset($mixedResult['id'])) {
-            $this->log($mixedResult, 'Get Plan:');
+            $this->log($mixedResult, 'Get Plan:', BX_LOG_ERR);
 
             return array();
         }
@@ -542,7 +542,7 @@ class BxPaymentProviderPayPalApi extends BxBaseModPaymentProvider implements iBx
 
         $mixedResult = $this->_apiCallAuthorized($this->_sEndpoint . 'v1/billing/plans', $aParams, array(), 'get');
         if(empty($mixedResult) || !is_array($mixedResult) || !isset($mixedResult['plans'])) {
-            $this->log($mixedResult, 'Get Plans:');
+            $this->log($mixedResult, 'Get Plans:', BX_LOG_ERR);
 
             return array();
         }
@@ -560,7 +560,7 @@ class BxPaymentProviderPayPalApi extends BxBaseModPaymentProvider implements iBx
         ]);
 
         if($mixedResult === false || empty($mixedResult['access_token'])) {
-            $this->log($mixedResult, 'Get Token:');
+            $this->log($mixedResult, 'Get Token:', BX_LOG_ERR);
 
             return false;
         }
@@ -795,9 +795,9 @@ class BxPaymentProviderPayPalApi extends BxBaseModPaymentProvider implements iBx
         if(empty($sDescription))
             $sDescription = $oException->getMessage();
 
-        $this->log($sMessage . $sDescription);
+        $this->log($sMessage . $sDescription, '', BX_LOG_ERR);
         if(!empty($aError))
-            $this->log($aError);
+            $this->log($aError, '', BX_LOG_ERR);
 
         return false;
     }
@@ -816,7 +816,7 @@ class BxPaymentProviderPayPalApi extends BxBaseModPaymentProvider implements iBx
         if(!in_array($sType, array('PAYMENT.SALE.COMPLETED', 'PAYMENT.CAPTURE.REFUNDED', 'BILLING.SUBSCRIPTION.CANCELLED')))
             return 200;
 
-        $this->log($aEvent, 'Webhooks: ' . (!empty($sType) ? $sType : ''));
+        $this->log($aEvent, 'Webhooks: ' . (!empty($sType) ? $sType : ''), BX_LOG_INFO);
 
         $sMethod = '_processEvent' . bx_gen_method_name(strtolower($sType), array('.', '_', '-'));
     	if(!method_exists($this, $sMethod))

+ 4 - 4
modules/boonex/payment/classes/BxPaymentProviderStripeBasic.php

@@ -559,8 +559,8 @@ class BxPaymentProviderStripeBasic extends BxBaseModPaymentProvider
         if(!in_array($sType, array('invoice.payment_succeeded', 'charge.refunded', 'customer.subscription.deleted')))
             return 200;
 
-        $this->log('Webhooks: ' . (!empty($sType) ? $sType : ''));
-        $this->log($aEvent);
+        $this->log('Webhooks: ' . (!empty($sType) ? $sType : ''), '', BX_LOG_INFO);
+        $this->log($aEvent, '', BX_LOG_INFO);
 
         $sMethod = '_processEvent' . bx_gen_method_name($sType, array('.', '_', '-'));
     	if(!method_exists($this, $sMethod))
@@ -628,8 +628,8 @@ class BxPaymentProviderStripeBasic extends BxBaseModPaymentProvider
         if(empty($sMessage))
             $sMessage = $oException->getMessage();
 
-        $this->log($sMessage . $aError['error']['message']);
-        $this->log($aError);
+        $this->log($sMessage . $aError['error']['message'], '', BX_LOG_ERR);
+        $this->log($aError, '', BX_LOG_ERR);
 
         return false;
     }

+ 2 - 2
modules/boonex/payment/classes/BxPaymentProviderStripeConnect.php

@@ -1181,9 +1181,9 @@ class BxPaymentProviderStripeConnect extends BxPaymentProviderStripeBasic implem
             $aError = array();
         }
 
-        $this->log($sMessage . $sError);
+        $this->log($sMessage . $sError, '', BX_LOG_ERR);
         if(!empty($aError))
-            $this->log($aError);
+            $this->log($aError, '', BX_LOG_ERR);
 
         return false;
     }

+ 2 - 2
modules/boonex/payment/classes/BxPaymentProviderStripeV3.php

@@ -1175,9 +1175,9 @@ class BxPaymentProviderStripeV3 extends BxPaymentProviderStripeBasic implements
             $aError = array();
         }
 
-        $this->log($sMessage . $sError);
+        $this->log($sMessage . $sError, '', BX_LOG_ERR);
         if(!empty($aError))
-            $this->log($aError);
+            $this->log($aError, '', BX_LOG_ERR);
 
         return false;
     }

+ 1 - 1
modules/boonex/profiler/classes/BxProfiler.php

@@ -150,7 +150,7 @@ class BxProfiler extends BxDol
 
     function _appendToLog ($s)
     {
-		bx_log('bx_profiler', $s);
+		bx_log('bx_profiler', $s, BX_LOG_INFO);
     }
 
     function logSqlQuery ($iTime, $aSqlQuery, &$oStmt)

+ 1 - 1
modules/boonex/smtpmailer/classes/BxSMTPModule.php

@@ -223,7 +223,7 @@ class BxSMTPModule extends BxDolModule
 
     function log ($s)
     {
-        bx_log('bx_smtp_mailer', $s);
+        bx_log('bx_smtp_mailer', $s, BX_LOG_ERR);
     }
 }
 

+ 3 - 3
modules/boonex/stream/classes/BxStrmEngineOvenMediaEngine.php

@@ -97,11 +97,11 @@ class BxStrmEngineOvenMediaEngine extends BxDol
                 $bDeleteRecording = true;
             }
             else {
-                bx_log('bx_stream', "Store recording from URL(" . $sFileUrl . ") failed for content id({$aContentInfo['id']}): " . $oStorage->getErrorString());
+                bx_log('bx_stream', "Store recording from URL(" . $sFileUrl . ") failed for content id({$aContentInfo['id']}): " . $oStorage->getErrorString(), BX_LOG_ERR);
             }
         }
         else {
-            bx_log('bx_stream', "Store recording failed because 'bx_stream_recordings' storage doesn't exist");
+            bx_log('bx_stream', "Store recording failed because 'bx_stream_recordings' storage doesn't exist", BX_LOG_ERR);
             $bDeleteRecording = true;
         }
 
@@ -203,7 +203,7 @@ class BxStrmEngineOvenMediaEngine extends BxDol
 
         $sUrl = $sApiProtocol . "://{$sHost}:$iApiPort/v1{$sUri}";
         $s = bx_file_get_contents($sUrl, $aBody, $sMethod, ['Authorization: Basic ' . $sApiKey]);
-        bx_log('bx_stream_ome_api', $sUrl . "\n" . $s);
+        bx_log('bx_stream_ome_api', $sUrl . "\n" . $s, BX_LOG_DEBUG);
         if (!$s)
             return false;
 

+ 2 - 2
modules/boonex/stream/classes/BxStrmModule.php

@@ -77,7 +77,7 @@ class BxStrmModule extends BxBaseModTextModule
         if ($oStorage = BxDolStorage::getObjectInstance('bx_stream_recordings')) {
             $iFileId = $oStorage->storeFileFromUrl($sUrl, true, $aContentInfo[$CNF['FIELD_AUTHOR']], $aContentInfo['id']);
             if (!$iFileId)
-                bx_log('bx_stream', "Store recording from URL(" . $sUrl . ") failed for content id({$aContentInfo['id']})");
+                bx_log('bx_stream', "Store recording from URL(" . $sUrl . ") failed for content id({$aContentInfo['id']})", BX_LOG_ERR);
         }
     }
 
@@ -324,7 +324,7 @@ class BxStrmModule extends BxBaseModTextModule
 
             }
             else {
-                bx_log('bx_stream', "No recording ID defined for content ID($iContentId)");
+                bx_log('bx_stream', "No recording ID defined for content ID($iContentId)", BX_LOG_ERR);
             }
         }
 

+ 1 - 1
modules/boonex/stripe_connect/classes/BxStripeConnectApi.php

@@ -199,7 +199,7 @@ class BxStripeConnectApi extends BxDol
         else if (is_object($sContents))
             $sContents = json_encode($sContents);
 
-        bx_log('bx_stripe_connect', $sContents);
+        bx_log('bx_stripe_connect', $sContents, BX_LOG_ERR);
     }
 }
 

+ 1 - 1
modules/boonex/stripe_connect/classes/BxStripeConnectModule.php

@@ -477,7 +477,7 @@ class BxStripeConnectModule extends BxBaseModGeneralModule
         else if (is_object($sContents))
             $sContents = json_encode($sContents);
 
-        bx_log('bx_stripe_connect', $sContents);
+        bx_log('bx_stripe_connect', $sContents, BX_LOG_ERR);
     }
 }
 

+ 1 - 1
modules/boonex/timeline/classes/BxTimelineDb.php

@@ -1564,7 +1564,7 @@ class BxTimelineDb extends BxBaseModNotificationsDb
             foreach($aTracks as $aTrack)
                 $sTracks .= "{$aTrack['file']} ({$aTrack['line']})\n";
 
-            bx_log('bx_timeline_custom', $sTracks);
+            bx_log('bx_timeline_custom', $sTracks, BX_LOG_DEBUG);
         }
             
         return parent::insertEvent($aParamsSet);

+ 10 - 10
modules/boonex/xero/classes/BxXeroApi.php

@@ -97,7 +97,7 @@ class BxXeroApi extends BxDol
             return $this->_oModule->_oConfig->getAuthorizeUrl(0);
         }
         catch (\League\OAuth2\Client\Provider\Exception\IdentityProviderException $oException) {
-            bx_log($this->_oModule->getName(), ":\n[API] Callback failed: " . $oException->getMessage());
+            bx_log($this->_oModule->getName(), ":\n[API] Callback failed: " . $oException->getMessage(), BX_LOG_ERR);
             return false;
         }
     }
@@ -146,7 +146,7 @@ class BxXeroApi extends BxDol
             }
         }
         catch (Exception $oException) {
-            bx_log($this->_oModule->getName(), ":\n[API] Add Contact: " . $oException->getMessage());
+            bx_log($this->_oModule->getName(), ":\n[API] Add Contact: " . $oException->getMessage(), BX_LOG_ERR);
         }
 
         return $mixedResult;
@@ -167,7 +167,7 @@ class BxXeroApi extends BxDol
                 $mixedResult = $oXeroResponse->getContacts()[0];
         }
         catch (Exception $oException) {
-            bx_log($this->_oModule->getName(), ":\n[API] Get Contact: " . $oException->getMessage());
+            bx_log($this->_oModule->getName(), ":\n[API] Get Contact: " . $oException->getMessage(), BX_LOG_ERR);
         }
 
         return $mixedResult;
@@ -199,7 +199,7 @@ class BxXeroApi extends BxDol
                 $mixedResult = $oXeroResponse->getContacts();
         }
         catch (Exception $oException) {
-            bx_log($this->_oModule->getName(), ":\n[API] Get Contacts: " . $oException->getMessage());
+            bx_log($this->_oModule->getName(), ":\n[API] Get Contacts: " . $oException->getMessage(), BX_LOG_ERR);
         }
 
         return $mixedResult;
@@ -297,7 +297,7 @@ class BxXeroApi extends BxDol
                 $mixedResult = $oXeroResponse->getInvoices()[0]->getInvoiceId();
         }
         catch (Exception $oException) {
-            bx_log($this->_oModule->getName(), ":\n[API] Add Invoice: " . $oException->getMessage());
+            bx_log($this->_oModule->getName(), ":\n[API] Add Invoice: " . $oException->getMessage(), BX_LOG_ERR);
         }
 
         return $mixedResult;
@@ -321,7 +321,7 @@ class BxXeroApi extends BxDol
                 $mixedResult = $oXeroResponse->getInvoices();
         }
         catch (Exception $oException) {
-            bx_log($this->_oModule->getName(), ":\n[API] Get Invoices: " . $oException->getMessage());
+            bx_log($this->_oModule->getName(), ":\n[API] Get Invoices: " . $oException->getMessage(), BX_LOG_ERR);
         }
 
         return $mixedResult;
@@ -342,7 +342,7 @@ class BxXeroApi extends BxDol
                 $mixedResult = $oXeroResponse->getInvoices()[0];
         }
         catch (Exception $oException) {
-            bx_log($this->_oModule->getName(), ":\n[API] Get Invoice: " . $oException->getMessage());
+            bx_log($this->_oModule->getName(), ":\n[API] Get Invoice: " . $oException->getMessage(), BX_LOG_ERR);
         }
 
         return $mixedResult;
@@ -363,7 +363,7 @@ class BxXeroApi extends BxDol
             $oXeroApi->emailInvoice($sTenantId, $sInvoiceId, $oRequestEmpty);            
         } 
         catch (Exception $oException) {
-            bx_log($this->_oModule->getName(), ":\n[API] Send Invoice: " . $oException->getMessage());
+            bx_log($this->_oModule->getName(), ":\n[API] Send Invoice: " . $oException->getMessage(), BX_LOG_ERR);
             $bResult = false;
         }
 
@@ -389,12 +389,12 @@ class BxXeroApi extends BxDol
     {
         $sTenantId = $this->_oModule->_oConfig->getTenantId();
         if($sTenantId === false) {
-            bx_log($this->_oModule->getName(), ":\n[API] Fetch failed: Empty Tenant ID.");
+            bx_log($this->_oModule->getName(), ":\n[API] Fetch failed: Empty Tenant ID.", BX_LOG_ERR);
             return false;
         }
 
         if(!$this->isAuthorized()) {
-            bx_log($this->_oModule->getName(), ":\n[API] Fetch failed: Unauthorized access.");
+            bx_log($this->_oModule->getName(), ":\n[API] Fetch failed: Unauthorized access.", BX_LOG_ERR);
             return false;
         }
 

+ 3 - 3
modules/boonex/xero/classes/BxXeroModule.php

@@ -68,7 +68,7 @@ class BxXeroModule extends BxDolModule
         $sSignatureReceived = isset($_SERVER['HTTP_X_XERO_SIGNATURE']) ? $_SERVER['HTTP_X_XERO_SIGNATURE'] : '';
 
         if(!hash_equals($sSignatureComputed, $sSignatureReceived)) {
-            bx_log($this->getName(), ":\n[Core] Get Webhook: Wrong Signature (" . $sSignatureComputed . ", " . $sSignatureReceived . ")");
+            bx_log($this->getName(), ":\n[Core] Get Webhook: Wrong Signature (" . $sSignatureComputed . ", " . $sSignatureReceived . ")", BX_LOG_ERR);
             http_response_code(401);
             return;
         }
@@ -200,7 +200,7 @@ class BxXeroModule extends BxDolModule
         bx_log($this->getName(), [
             ":\n[Core] Create Invoice: " . $sId,
             $aInvoice
-        ]);
+        ], BX_LOG_ERR);
 
         bx_alert($this->_oConfig->getName(), 'invoice_created', 0, 0, array(
             'id' => $sId,
@@ -216,7 +216,7 @@ class BxXeroModule extends BxDolModule
         bx_log($this->getName(), [
             ":\n[Core] Update Invoice: " . $sId,
             $aInvoice
-        ]);
+        ], BX_LOG_ERR);
 
         bx_alert($this->_oConfig->getName(), 'invoice_updated', 0, 0, array(
             'id' => $sId,

+ 1 - 1
periodic/cron.php

@@ -122,7 +122,7 @@ function runJob($aJob)
     } else if (!empty($aJob['service_call']) && BxDolService::isSerializedService($aJob['service_call'])) {
         BxDolService::callSerialized($aJob['service_call']);
     }
-    bx_log('sys_cron_jobs', $aJob['name'] . ' / timing: ' . (microtime(true) - $fStart) . ' / memory: ' . memory_get_usage());
+    bx_log('sys_cron_jobs', $aJob['name'] . ' / timing: ' . (microtime(true) - $fStart) . ' / memory: ' . memory_get_usage(), BX_LOG_INFO);
     $oDb->updateJob($aJob['id'], array('timing' => microtime(true) - $fStart));
 }
 

+ 8 - 8
studio/classes/BxDolStudioInstallerUtils.php

@@ -262,7 +262,7 @@ class BxDolStudioInstallerUtils extends BxDolInstallerUtils implements iBxDolSin
         if(empty($aConfig) || !file_exists($sPathInstaller)) {
             $sMessage = _t('_adm_mod_err_process_operation_failed', $sOperation, $sDirectory);
 
-            bx_log('sys_modules', ":\n[" . $sOperation . "] Operation failed: " . $this->getModuleTitle($aParams) . "\n" . strip_tags($sMessage));
+            bx_log('sys_modules', ":\n[" . $sOperation . "] Operation failed: " . $this->getModuleTitle($aParams) . "\n" . strip_tags($sMessage), BX_LOG_ERR);
             
             if($bTransient)
                 $this->emailNotify($sMessage, $aParams);
@@ -277,7 +277,7 @@ class BxDolStudioInstallerUtils extends BxDolInstallerUtils implements iBxDolSin
         $aResult = $oInstaller->$sOperation($aParams);
 
         if(!$aResult['result']) {
-            bx_log('sys_modules', ":\n[" . $sOperation . "] Operation failed: " . $this->getModuleTitle($aParams) . "\n" . strip_tags($aResult['message']));
+            bx_log('sys_modules', ":\n[" . $sOperation . "] Operation failed: " . $this->getModuleTitle($aParams) . "\n" . strip_tags($aResult['message']), BX_LOG_ERR);
 
             if($bTransient)
                 $this->emailNotify($aResult['message'], $aParams);
@@ -313,7 +313,7 @@ class BxDolStudioInstallerUtils extends BxDolInstallerUtils implements iBxDolSin
         $aFailed = array();
         $aUpdates = $this->checkUpdates();
         if(empty($aUpdates) || !is_array($aUpdates)) {
-            bx_log('sys_modules', ":\n[upgrade] Cannot get a list of modules which require to be updated.");
+            bx_log('sys_modules', ":\n[upgrade] Cannot get a list of modules which require to be updated.", BX_LOG_ERR);
             return true;
         }
 
@@ -328,7 +328,7 @@ class BxDolStudioInstallerUtils extends BxDolInstallerUtils implements iBxDolSin
         $aSuccess = array();
         $aUpdates = $this->getUpdates();
         if(empty($aUpdates) || !is_array($aUpdates)) {
-            bx_log('sys_modules', ":\n[upgrade] Cannot find update scripts for modules. They are damaged or were not downloaded.");
+            bx_log('sys_modules', ":\n[upgrade] Cannot find update scripts for modules. They are damaged or were not downloaded.", BX_LOG_ERR);
             return true;
         }
 
@@ -354,7 +354,7 @@ class BxDolStudioInstallerUtils extends BxDolInstallerUtils implements iBxDolSin
             bx_log('sys_modules', [
                 ":\n[upgrade] Failed to update modules:",
                 $aFailed
-            ]);
+            ], BX_LOG_ERR);
 
             if($bTransient)
                 $this->emailNotifyModulesUpgrade('failed', $aFailed);
@@ -364,7 +364,7 @@ class BxDolStudioInstallerUtils extends BxDolInstallerUtils implements iBxDolSin
             bx_log('sys_modules', [
                 ":\n[upgrade] Successfully updated modules:",
                 $aSuccess
-            ]);
+            ], BX_LOG_INFO);
 
             if($bTransient)
                 $this->emailNotifyModulesUpgrade('success', $aSuccess);
@@ -487,7 +487,7 @@ class BxDolStudioInstallerUtils extends BxDolInstallerUtils implements iBxDolSin
 
         @unlink($sFilePath);
         if($mixedResult !== true) {
-            bx_log('sys_modules', ":\n[download] Operation failed: " . $this->getModuleTitle($aParams) . "\n" . $mixedResult);
+            bx_log('sys_modules', ":\n[download] Operation failed: " . $this->getModuleTitle($aParams) . "\n" . $mixedResult, BX_LOG_ERR);
 
             if($bTransient)
                 $this->emailNotify($mixedResult, $aParams);
@@ -501,7 +501,7 @@ class BxDolStudioInstallerUtils extends BxDolInstallerUtils implements iBxDolSin
 
         @bx_rrmdir($sPackagePath);
         if($mixedResult !== true) {
-            bx_log('sys_modules', ":\n[download] Operation failed: " . $this->getModuleTitle($aParams) . "\n" . $mixedResult);
+            bx_log('sys_modules', ":\n[download] Operation failed: " . $this->getModuleTitle($aParams) . "\n" . $mixedResult, BX_LOG_ERR);
 
             if($bTransient)
                 $this->emailNotify($mixedResult, $aParams);