當前位置: 首頁>>代碼示例>>PHP>>正文


PHP JLog::addLogger方法代碼示例

本文整理匯總了PHP中JLog::addLogger方法的典型用法代碼示例。如果您正苦於以下問題:PHP JLog::addLogger方法的具體用法?PHP JLog::addLogger怎麽用?PHP JLog::addLogger使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在JLog的用法示例。


在下文中一共展示了JLog::addLogger方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: sendOrderInformations

 /**
  * Sends the tracking information to mailchimp if we have the tracking ids
  * Logs errors
  * @param $store_id
  * @param string $store_name
  * @param int $order_id
  * @param int $total_amount
  * @param int $tax_amount
  * @param int $shipping_amount
  * @param array $products
  * @return bool
  */
 public static function sendOrderInformations($store_id, $store_name = "Store name", $order_id = 0, $total_amount = 0, $tax_amount = 0, $shipping_amount = 0, $products = array(0 => array("product_id" => 0, "sku" => "", "product_name" => "", "category_id" => 0, "category_name" => "", "qty" => 1.0, "cost" => 0.0)))
 {
     // log the errors to a file
     JLog::addLogger(array('text_file' => 'com_cmc_ecom360.php'));
     $session = JFactory::getSession();
     $mc_cid = $session->get('mc_cid', '');
     $mc_eid = $session->get('mc_eid', '');
     if (!$mc_cid && !$mc_eid) {
         JLog::add('No cid and eid specified for the request', JLOG::ERROR);
         return false;
     }
     $order = array();
     $order["id"] = $order_id;
     $order["email_id"] = $mc_eid;
     $order["total"] = (double) $total_amount;
     $order["shipping"] = (double) $shipping_amount;
     $order["tax"] = (double) $tax_amount;
     $order["store_id"] = $store_id;
     $order["store_name"] = $store_name;
     $order["campaign_id"] = $mc_cid;
     // Optional
     $order["items"] = $products;
     $api = new cmcHelperChimp();
     $api->ecommOrderAdd($order);
     if ($api->errorCode) {
         JLog::add($api->errorMessage, JLOG::ERROR, $api->errorCode);
         return false;
     }
     return true;
 }
開發者ID:fracting,項目名稱:cmc,代碼行數:42,代碼來源:ecom360.php

示例2: __construct

 function __construct()
 {
     // Include the JLog class.
     jimport('joomla.log.log');
     // Add the logger.
     JLog::addLogger(array('logger' => 'database'));
 }
開發者ID:rhotog,項目名稱:fabrik,代碼行數:7,代碼來源:ipn.php

示例3: __construct

 public function __construct($config = array())
 {
     parent::__construct($config);
     if (JDEBUG) {
         JLog::addLogger(array('text_file' => 'com_usernotes.log.php'), JLog::ALL, array('com_usernotes'));
     }
 }
開發者ID:ron4mac,項目名稱:joomla_com_usernotes,代碼行數:7,代碼來源:edit.php

示例4: __construct

 public function __construct()
 {
     JLog::addLogger(array('text_file' => "jotcache.recache.log.php", 'text_entry_format' => "{DATE} {TIME}\t{MESSAGE}", 'text_file_path' => JPATH_ROOT . '/logs'), JLog::INFO, 'jotcache.recache');
     $this->dbo = JFactory::getDBO();
     $this->recacheParams = JComponentHelper::getParams('com_jotcache');
     $this->logging = $this->recacheParams->get('recachelog', 0) == 1 ? true : false;
 }
開發者ID:naka211,項目名稱:myloyal,代碼行數:7,代碼來源:recacherunner.php

示例5: onLogInitialise

 /**
  * Fired on log initialiser.
  *
  * @return  void
  *
  * @since   2.0
  */
 public function onLogInitialise()
 {
     // This is the columns that the log files will use
     $fileFormat = str_replace('\\t', "\t", $this->params->get('file_format', '{DATETIME}\\t{ID}\\t{MESSAGE}'));
     /*
      * Deals with the Information level logs.
      */
     if ($this->params->get('enable_info', true)) {
         // Setup a information file logger
         JLog::addLogger(array('logger' => self::LOGGER_FILE, 'text_file' => $this->params->get('log_name_info', 'sso.info.php'), 'text_entry_format' => $fileFormat), JLog::INFO, array(self::SSO_CATEGORY, self::AUTH_CATEGORY));
     }
     /*
      * Deals with the Debugging level logs (which includes all levels internally).
      */
     if ($this->params->get('enable_debug', true)) {
         // Setup a debugger file logger
         JLog::addLogger(array('logger' => self::LOGGER_FILE, 'text_file' => $this->params->get('log_name_debug', 'sso.debug.php'), 'text_entry_format' => $fileFormat), JLog::ALL, array(self::SSO_CATEGORY, self::AUTH_CATEGORY));
     }
     /*
      * Deals with the Error level logs.
      */
     if ($this->params->get('enable_error', true)) {
         // Setup a error file logger
         JLog::addLogger(array('logger' => self::LOGGER_FILE, 'text_file' => $this->params->get('log_name_error', 'sso.error.php'), 'text_entry_format' => $fileFormat), JLog::ERROR, array(self::SSO_CATEGORY, self::AUTH_CATEGORY));
         if ($this->params->get('error_to_screen', true)) {
             // Setup a error on-screen logger
             JLog::addLogger(array('logger' => self::LOGGER_SCREEN), JLog::ERROR, array(self::SSO_CATEGORY, self::AUTH_CATEGORY));
         }
     }
 }
開發者ID:philbertphotos,項目名稱:JMapMyLDAP,代碼行數:37,代碼來源:sso.php

示例6: __construct

 public function __construct(&$subject, $config)
 {
     parent::__construct($subject, $config);
     $this->loadLanguage();
     $lang = JFactory::getLanguage();
     $lang->load('plg_djclassifiedspayment_djcf2co', JPATH_ROOT . DS . 'plugins' . DS . 'djclassifiedspayment' . DS . 'djcf2co', 'en-GB', false, false);
     $lang->load('plg_djclassifiedspayment_djcf2co', JPATH_ADMINISTRATOR, 'en-GB', false, false);
     $lang->load('plg_djclassifiedspayment_djcf2co', JPATH_ROOT . DS . 'plugins' . DS . 'djclassifiedspayment' . DS . 'djcf2co', null, true, false);
     $lang->load('plg_djclassifiedspayment_djcf2co', JPATH_ADMINISTRATOR, null, true, false);
     $params["plugin_name"] = "djcf2co";
     $params["icon"] = "2checkout-logo.png";
     $params["logo"] = "2checkout-logo.png";
     $params["description"] = JText::_("PLG_DJCLASSIFIEDSPAYMENT_DJCF2CO_PAYMENT_METHOD_DESC");
     $params["payment_method"] = JText::_("PLG_DJCLASSIFIEDSPAYMENT_DJCF2CO_PAYMENT_METHOD_NAME");
     $params["testmode"] = $this->params->get("test", "1");
     $params["currency_code"] = $this->params->get("currency_code", "USD");
     $params["sid"] = $this->params->get("sid", null);
     $params["secret_word"] = $this->params->get("secret_word", null);
     $params["2co_url"] = 'https://www.2checkout.com/checkout/purchase';
     $params["debug"] = $this->params->get('debug', null);
     if ($this->params->get('debug', null) == '1') {
         JLog::addLogger(array('logger' => 'formattedtext', 'text_file' => 'djcf2co.log.php'), JLog::ALL, array('djcf2co'));
     }
     $this->params = $params;
 }
開發者ID:kidaa30,項目名稱:lojinha,代碼行數:25,代碼來源:djcf2co.php

示例7: __construct

 public function __construct(&$subject, $config)
 {
     parent::__construct($subject, $config);
     $this->loadLanguage();
     $lang = JFactory::getLanguage();
     $lang->load('plg_djclassifiedspayment_djcfSkrill', JPATH_ROOT . DS . 'plugins' . DS . 'djclassifiedspayment' . DS . 'djcfSkrill', 'en-GB', false, false);
     $lang->load('plg_djclassifiedspayment_djcfSkrill', JPATH_ADMINISTRATOR, 'en-GB', false, false);
     $lang->load('plg_djclassifiedspayment_djcfSkrill', JPATH_ROOT . DS . 'plugins' . DS . 'djclassifiedspayment' . DS . 'djcfSkrill', null, true, false);
     $lang->load('plg_djclassifiedspayment_djcfSkrill', JPATH_ADMINISTRATOR, null, true, false);
     $params["plugin_name"] = "djcfskrill";
     $params["icon"] = "skrill_logo.png";
     $params["logo"] = "skrill_logo.png";
     $params["description"] = JText::_("PLG_DJCLASSIFIEDSPAYMENT_DJCFSKRILL_PAYMENT_METHOD_DESC");
     $params["payment_method"] = JText::_("PLG_DJCLASSIFIEDSPAYMENT_DJCFSKRILL_PAYMENT_METHOD_NAME");
     //$params["testmode"] = $this->params->get("test", "1");
     $params["currency_code"] = $this->params->get("currency_code", "USD");
     $params["merchant_id"] = $this->params->get("merchant_id", null);
     $params["pay_to_email"] = $this->params->get("pay_to_email", null);
     $params["secret_word"] = $this->params->get("secret_word", null);
     $params["skrill_url"] = 'https://www.moneybookers.com/app/payment.pl';
     $params["skrill_test_url"] = 'https://www.moneybookers.com/app/test_payment.pl';
     $params["debug"] = $this->params->get('debug', null);
     $params["languages"] = array('EN', 'DE', 'ES', 'FR', 'IT', 'PL', 'GR', 'RO', 'RU', 'TR', 'CN', 'CZ', 'NL', 'DA', 'SV', 'FI');
     if ($this->params->get('debug', null) == '1') {
         JLog::addLogger(array('logger' => 'formattedtext', 'text_file' => 'djcfskrill.log.php'), JLog::ALL, array('djcfskrill'));
     }
     $this->params = $params;
 }
開發者ID:kidaa30,項目名稱:lojinha,代碼行數:28,代碼來源:djcfskrill.php

示例8: startJoomlaDbErrorLogger

 /**
  * Set db logger. Since all JErrors E_ERROR will be added to log.
  * Usefull if you render something J! native. 
  * Covers all E_ERROR generated by 
  * JError::raiseError, JError::raise, JError::throwError.
  * 
  * All execs of JLog::add(...) with 
  * JLog::EMERGENCY | JLog::ALERT | JLog::CRITICAL | JLog::ERROR
  * will be added to LOGS table.
  */
 public static function startJoomlaDbErrorLogger()
 {
     // Add handler to JError for E_ERROR
     JError::setErrorHandling(E_ERROR, 'callback', array('LogHelper', 'addJError'));
     // Now we log all the troubles into our LOGS table.
     JLog::addLogger(array('logger' => 'database', 'db_table' => '#__newsletter_logs'), JLog::EMERGENCY | JLog::ALERT | JLog::CRITICAL | JLog::ERROR);
 }
開發者ID:Rikisha,項目名稱:proj,代碼行數:17,代碼來源:log.php

示例9: getPicasawebResult

 /**
  * returns the name of the file for this url.
  */
 public static function getPicasawebResult($url)
 {
     $params = JComponentHelper::getParams('com_eventgallery');
     $cachelifetime = $params->get('cache_picasa_lifetime', self::$cache_life);
     JLog::addLogger(array('text_file' => 'com_eventgallery.log.php', 'logger' => 'Eventgalleryformattedtext'), JLog::ALL, 'com_eventgallery');
     //JLog::add('processing url '.$url, JLog::INFO, 'com_eventgallery');
     self::initCacheDirs();
     $cachefilename = self::$cachebasedir . md5($url) . '.xml';
     if (file_exists($cachefilename) && time() - filemtime($cachefilename) <= $cachelifetime) {
         // no need to do anything since the cache is still valid
     } else {
         //JLog::add('have writen new cache file for '.$url, JLog::INFO, 'com_eventgallery');
         $xml = @file_get_contents($url);
         if ($xml === false) {
             JLog::add('unable to connect to remote host. Make sure allow_url_fopen=On and the server has access to the internet. url: ' . $url, JLog::INFO, 'com_eventgallery');
         }
         $xml = str_replace("xmlns='http://www.w3.org/2005/Atom'", '', $xml);
         #echo "reloading content from $url <br>";
         if (strlen($xml) > 0) {
             $fh = fopen($cachefilename, 'w') or die("can't open file {$cachefilename}");
             fwrite($fh, $xml);
             fclose($fh);
         }
     }
     $xml = NULL;
     return $cachefilename;
 }
開發者ID:sansandeep143,項目名稱:av,代碼行數:30,代碼來源:helper.php

示例10: __construct

 /**
  * Constructor.
  *
  * @param   object  &$subject  The object to observe
  * @param   array   $config    An array that holds the plugin configuration
  *
  * @since 1.5
  */
 public function __construct(&$subject, $config)
 {
     parent::__construct($subject, $config);
     // Log the deprecated API.
     if ($this->params->get('log-deprecated')) {
         \JLog::addLogger(array('text_file' => 'deprecated.php'), \JLog::ALL, array('deprecated'));
     }
     // Log database errors
     if ($this->params->get('log-database-errors')) {
         \JLog::addLogger(array('text_file' => 'jdatabase.error.php'), \JLog::ALL, array('database'));
     }
     // Log database queries
     if ($this->params->get('log-database-queries')) {
         \JLog::addLogger(array('text_file' => 'jdatabase.query.php'), \JLog::ALL, array('databasequery'));
         // Register the HUBzero database logger as well
         // Don't worry, this won't log things twice...queries through joomla's database driver
         // will get logged above, and this will catch queries through hubzero's database driver
         \Event::listen(function ($event) {
             \Hubzero\Database\Log::add($event->getArgument('query'), $event->getArgument('time'));
         }, 'database_query');
     }
     // Only if debugging or language debug is enabled
     if (Config::get('debug') || Config::get('debug_lang')) {
         Config::set('gzip', 0);
         ob_start();
         ob_implicit_flush(false);
     }
     $this->linkFormat = ini_get('xdebug.file_link_format');
 }
開發者ID:zooley,項目名稱:hubzero-cms,代碼行數:37,代碼來源:debug.php

示例11: __construct

 /**
  * Construct
  */
 public function __construct()
 {
     // Include the JLog class.
     jimport('joomla.log.log');
     // Add the logger.
     JLog::addLogger(array('text_file' => 'fabrik.subs.log.php'));
 }
開發者ID:jfquestiaux,項目名稱:fabrik,代碼行數:10,代碼來源:ipn.php

示例12: __construct

 /**
  * Constructor.
  *
  * @param   object  &$subject  The object to observe
  * @param   array   $config    An array that holds the plugin configuration
  *
  * @since 1.5
  */
 public function __construct(&$subject, $config)
 {
     parent::__construct($subject, $config);
     // Log the deprecated API.
     if ($this->params->get('log-deprecated')) {
         JLog::addLogger(array('text_file' => 'deprecated.php'), JLog::ALL, array('deprecated'));
     }
     $this->debugLang = JFactory::getApplication()->getCfg('debug_lang');
     // Only if debugging or language debug is enabled
     if (JDEBUG || $this->debugLang) {
         JFactory::getConfig()->set('gzip', 0);
         ob_start();
         ob_implicit_flush(false);
     }
     $this->linkFormat = ini_get('xdebug.file_link_format');
     if ($this->params->get('logs', 1)) {
         $priority = 0;
         foreach ($this->params->get('log_priorities', array()) as $p) {
             $const = 'JLog::' . strtoupper($p);
             if (!defined($const)) {
                 continue;
             }
             $priority |= constant($const);
         }
         // Split into an array at any character other than alphabet, numbers, _, ., or -
         $categories = array_filter(preg_split('/[^A-Z0-9_\\.-]/i', $this->params->get('log_categories', '')));
         $mode = $this->params->get('log_category_mode', 0);
         JLog::addLogger(array('logger' => 'callback', 'callback' => array($this, 'logger')), $priority, $categories, $mode);
     }
 }
開發者ID:GitIPFire,項目名稱:Homeworks,代碼行數:38,代碼來源:debug.php

示例13: display

 function display($tpl = null)
 {
     /*
     // load component parameters
     $params = JComponentHelper::getParams( 'com_chessvn' );
     $params = $app->getParams( 'com_chessvn' );	
     $dummy = $params->get( 'dummy_param', 1 ); 
     
     // load another model
     JModelLegacy::addIncludePath(JPATH_SITE.'/components/com_chessvn/models');
     $otherModel = JModelLegacy::getInstance( 'Record', 'RecordModel' );
     */
     $data = $this->get('Data');
     $this->assignRef('data', $data);
     // Check for errors.
     if (count($errors = $this->get('Errors'))) {
         JLog::add(implode('<br />', $errors), JLog::WARNING, 'jerror');
         return false;
     }
     $userid = JRequest::getVar('userid');
     $this->assignRef('userid', $userid);
     $gameid = JRequest::getVar('gameid');
     $this->assignRef('gameid', $gameid);
     jimport('joomla.log.log');
     JLog::addLogger(array());
     //        JLog::add(JText::_('$userid = '.$userid), JLog::INFO);
     //        $cvnuser = JFactory::getUser();
     //        $returnData = CvnDao::getChallenges();//$cvnuser->get('id')
     parent::display($tpl);
 }
開發者ID:khangcodt,項目名稱:nvssehcweb,代碼行數:30,代碼來源:view.xml.php

示例14: __construct

 public function __construct($options = array())
 {
     $this->debug = intval(JFBCFactory::config()->get('facebook_display_errors'));
     $this->text_file = isset($options['text_file']) ? $options['text_file'] : $this->text_file;
     if ($this->debug) {
         JLog::addLogger(array('text_file' => $this->text_file), JLog::ALL, 'jfbconnect');
     }
 }
開發者ID:q0821,項目名稱:esportshop,代碼行數:8,代碼來源:debug.php

示例15: Storelog

 public static function Storelog($name, $logdata)
 {
     jimport('joomla.error.log');
     $options = array('format' => "{DATE}\t{TIME}\t{USER}\t{DESC}");
     $path = JPATH_SITE . '/plugins/digicom-pay/' . $name . '/' . $name . '/';
     $my = JFactory::getUser();
     JLog::addLogger(array('user' => $my->name . '(' . $my->id . ')', 'desc' => json_encode($logdata['raw_data'])));
 }
開發者ID:Shtier,項目名稱:digicom,代碼行數:8,代碼來源:helper.php


注:本文中的JLog::addLogger方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。