Page MenuHomeIn-Portal Phabricator

D539.id1391.diff
No OneTemporary

File Metadata

Created
Tue, Sep 23, 12:49 PM

D539.id1391.diff

Index: admin/system_presets/simple/system_logs_system-log.php
===================================================================
--- admin/system_presets/simple/system_logs_system-log.php
+++ admin/system_presets/simple/system_logs_system-log.php
@@ -20,9 +20,10 @@
// fields to hide
$hidden_fields = Array (
/*'LogId', 'LogUniqueId', 'LogLevel', 'LogType', 'LogCode', 'LogMessage', 'LogTimestamp', 'LogDate',
- 'LogEventName', 'LogHostname', 'LogRequestSource', 'LogRequestURI', 'LogRequestData', 'LogUserId',
- 'LogInterface', 'IpAddress', 'LogSessionKey', 'LogSessionData', 'LogBacktrace', 'LogSourceFilename',
- 'LogSourceFileLine', 'LogProcessId', 'LogMemoryUsed', 'LogUserData', 'LogNotificationStatus',*/
+ 'LogEventName', 'LogHostname', 'LogServerHostname', 'LogRequestSource', 'LogRequestURI', 'LogRequestData',
+ 'LogUserId', 'LogInterface', 'IpAddress', 'LogSessionKey', 'LogSessionData', 'LogBacktrace',
+ 'LogSourceFilename', 'LogSourceFileLine', 'LogProcessId', 'LogMemoryUsed', 'LogUserData',
+ 'LogNotificationStatus',*/
);
// virtual fields to hide
@@ -33,9 +34,10 @@
// fields to make required
$required_fields = Array (
/*'LogId', 'LogUniqueId', 'LogLevel', 'LogType', 'LogCode', 'LogMessage', 'LogTimestamp', 'LogDate',
- 'LogEventName', 'LogHostname', 'LogRequestSource', 'LogRequestURI', 'LogRequestData', 'LogUserId',
- 'LogInterface', 'IpAddress', 'LogSessionKey', 'LogSessionData', 'LogBacktrace', 'LogSourceFilename',
- 'LogSourceFileLine', 'LogProcessId', 'LogMemoryUsed', 'LogUserData', 'LogNotificationStatus',*/
+ 'LogEventName', 'LogHostname', LogServerHostname, 'LogRequestSource', 'LogRequestURI', 'LogRequestData',
+ 'LogUserId', 'LogInterface', 'IpAddress', 'LogSessionKey', 'LogSessionData', 'LogBacktrace',
+ 'LogSourceFilename', 'LogSourceFileLine', 'LogProcessId', 'LogMemoryUsed', 'LogUserData',
+ 'LogNotificationStatus',*/
);
// virtual fields to make required
@@ -47,8 +49,8 @@
$hide_columns = Array (
/*'Default' => Array (
'LogId', 'LogLevel', 'LogType', 'LogCode', 'LogMessage', 'LogTimestamp', 'LogEventName', 'LogHostname',
- 'LogRequestSource', 'LogRequestURI', 'Username', 'LogInterface', 'IpAddress', 'LogSessionKey',
- 'LogSourceFilename', 'LogSourceFileLine', 'LogProcessId', 'LogMemoryUsed', 'LogUserData',
+ 'LogServerHostname', 'LogRequestSource', 'LogRequestURI', 'Username', 'LogInterface', 'IpAddress',
+ 'LogSessionKey', 'LogSourceFilename', 'LogSourceFileLine', 'LogProcessId', 'LogMemoryUsed', 'LogUserData',
'LogNotificationStatus', 'LogBacktrace',
),*/
);
Index: core/admin_templates/logs/system_logs/system_log_edit.tpl
===================================================================
--- core/admin_templates/logs/system_logs/system_log_edit.tpl
+++ core/admin_templates/logs/system_logs/system_log_edit.tpl
@@ -143,6 +143,7 @@
</inp2:m_if>
<inp2:m_RenderElement name="inp_label" prefix="system-log" field="LogHostname"/>
+ <inp2:m_RenderElement name="inp_label" prefix="system-log" field="LogServerHostname"/>
<inp2:m_RenderElement name="inp_label" prefix="system-log" field="LogInterface"/>
<inp2:m_RenderElement name="inp_label" prefix="system-log" field="LogRequestSource"/>
Index: core/install/english.lang
===================================================================
--- core/install/english.lang
+++ core/install/english.lang
@@ -544,6 +544,7 @@
<PHRASE Label="la_fld_LogRequestData" Module="Core" Type="1" Column="UmVxdWVzdCBEYXRh">UmVxdWVzdCBEYXRh</PHRASE>
<PHRASE Label="la_fld_LogRequestSource" Module="Core" Type="1" Column="UmVxdWVzdCBTb3VyY2U=">UmVxdWVzdCBTb3VyY2U=</PHRASE>
<PHRASE Label="la_fld_LogRequestURI" Module="Core" Type="1" Column="UmVxdWVzdCBVUkk=">UmVxdWVzdCBVUkk=</PHRASE>
+ <PHRASE Label="la_fld_LogServerHostname" Module="Core" Type="1" Column="U2VydmVyIEhvc3RuYW1l">U2VydmVyIEhvc3RuYW1l</PHRASE>
<PHRASE Label="la_fld_LogSessionData" Module="Core" Type="1" Column="U2Vzc2lvbiBEYXRh">U2Vzc2lvbiBEYXRh</PHRASE>
<PHRASE Label="la_fld_LogSessionKey" Module="Core" Type="1" Column="U2Vzc2lvbiBLZXk=">U2Vzc2lvbiBLZXk=</PHRASE>
<PHRASE Label="la_fld_LogSourceFileLine" Module="Core" Type="1" Column="U291cmNlIEZpbGUgTGluZQ==">U291cmNlIEZpbGUgTGluZQ==</PHRASE>
Index: core/install/install_schema.sql
===================================================================
--- core/install/install_schema.sql
+++ core/install/install_schema.sql
@@ -438,6 +438,7 @@
LogDate datetime DEFAULT NULL,
LogEventName varchar(100) NOT NULL DEFAULT '',
LogHostname varchar(255) NOT NULL DEFAULT '',
+ LogServerHostname varchar(255) NOT NULL DEFAULT '',
LogRequestSource tinyint(4) DEFAULT NULL,
LogRequestURI varchar(255) NOT NULL DEFAULT '',
LogRequestData longtext,
Index: core/install/upgrades.sql
===================================================================
--- core/install/upgrades.sql
+++ core/install/upgrades.sql
@@ -3009,3 +3009,5 @@
INSERT INTO SystemSettings VALUES (DEFAULT, 'SystemLogRequestDataRotationInterval', '2419200', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsLogs', 'la_config_SystemLogRequestDataRotationInterval', 'select', NULL, '86400=la_opt_OneDay||604800=la_opt_OneWeek||1209600=la_opt_TwoWeeks||2419200=la_opt_OneMonth||7257600=la_opt_ThreeMonths||29030400=la_opt_OneYear||-1=la_opt_SystemLogKeepForever', 65.04, 0, 1, 'hint:la_config_SystemLogRequestDataRotationInterval');
ALTER TABLE SystemLog ADD COLUMN `LogRequestDataRotated` tinyint NOT NULL DEFAULT '0' AFTER `LogRequestData`;
ALTER TABLE SystemLog ADD INDEX `TIMESTAMP_REQUEST_DATA_ROTATED` (`LogTimestamp`,`LogRequestDataRotated`) USING BTREE;
+
+ALTER TABLE SystemLog ADD LogServerHostname varchar(255) NOT NULL DEFAULT '' AFTER LogHostname;
Index: core/kernel/utility/logger.php
===================================================================
--- core/kernel/utility/logger.php
+++ core/kernel/utility/logger.php
@@ -376,6 +376,7 @@
'LogCode' => $code,
'LogType' => self::LT_OTHER,
'LogHostname' => $_SERVER['HTTP_HOST'],
+ 'LogServerHostname' => gethostname(),
'LogRequestSource' => php_sapi_name() == 'cli' ? 2 : 1,
'LogRequestURI' => php_sapi_name() == 'cli' ? implode(' ', $GLOBALS['argv']) : $_SERVER['REQUEST_URI'],
'LogUserId' => USER_GUEST,
Index: core/units/logs/system_logs/system_logs_config.php
===================================================================
--- core/units/logs/system_logs/system_logs_config.php
+++ core/units/logs/system_logs/system_logs_config.php
@@ -143,6 +143,7 @@
'LogDate' => Array ('type' => 'string', 'default' => NULL),
'LogEventName' => Array ('type' => 'string', 'max_len' => 100, 'not_null' => 1, 'default' => ''),
'LogHostname' => Array ('type' => 'string', 'max_len' => 255, 'not_null' => 1, 'default' => ''),
+ 'LogServerHostname' => Array ('type' => 'string', 'max_len' => 255, 'not_null' => 1, 'default' => ''),
'LogRequestSource' => Array (
'type' => 'int',
'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'Web', 2 => 'CLI'),
@@ -215,6 +216,7 @@
'LogTimestamp' => Array ('filter_block' => 'grid_date_range_filter', 'width' => 170),
'LogEventName' => Array ('filter_block' => 'grid_like_filter'),
'LogHostname' => Array ('filter_block' => 'grid_like_filter'),
+ 'LogServerHostname' => Array ('filter_block' => 'grid_like_filter'),
'LogRequestSource' => Array ('filter_block' => 'grid_options_filter'),
'LogRequestURI' => Array ('data_block' => 'grid_uri_td', 'filter_block' => 'grid_like_filter'),
'Username' => Array ('filter_block' => 'grid_range_filter', 'width' => 80),

Event Timeline