/** * @static * @param string $_str */ function Log($_str) { static $_isFirst = true; static $_use = null; if ($_use === null) { $_use = isset($GLOBALS[AP_USELOG]); if (!$_use) { $_use = isset($_SESSION[AP_SESS_ENABLE]['log']); } } if ($_use) { $_date = @date('H:i:s'); $_path = CAdminPanel::AdminDataFolder(); if (false === $_path) { return; } if ($_isFirst) { $_uri = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : ''; $_isFirst = false; $_post = isset($_POST) && count($_POST) > 0 ? ' [POST(' . count($_POST) . ')]' : ''; @error_log("\r\n" . '[' . $_date . '] ---[start]---> ' . $_uri . $_post . AP_CRLF, 3, $_path . '/logs/' . AP_LOG_FILE); if (strlen($_post) > 0) { @error_log('[' . $_date . '] POST > [' . implode(', ', array_keys($_POST)) . "]\r\n", 3, $_path . '/logs/' . AP_LOG_FILE); } } $_str = str_replace(AP_CRLF, "\r\n\t", $_str); @error_log('[' . $_date . '] ' . $_str . AP_CRLF, 3, $_path . '/logs/' . AP_LOG_FILE); } }