Index: includes/bootstrap.inc =================================================================== --- includes/bootstrap.inc (revision 66) +++ includes/bootstrap.inc (working copy) @@ -838,7 +838,9 @@ 'referer' => referer_uri(), 'ip' => ip_address(), 'timestamp' => time(), - ); + 'server_addr' => $_SERVER['SERVER_ADDR'], + 'server_name' => $_SERVER['SERVER_NAME'], + ); // Call the logging hooks to log/process the message foreach (module_implements('watchdog', TRUE) as $module) { Index: modules/dblog/dblog.admin.inc =================================================================== --- modules/dblog/dblog.admin.inc (revision 66) +++ modules/dblog/dblog.admin.inc (working copy) @@ -59,10 +59,11 @@ array('data' => t('Date'), 'field' => 'w.wid', 'sort' => 'desc'), t('Message'), array('data' => t('User'), 'field' => 'u.name'), + array('data' => t('Server')), array('data' => t('Operations')), ); - $sql = "SELECT w.wid, w.uid, w.severity, w.type, w.timestamp, w.message, w.variables, w.link, u.name FROM {watchdog} w INNER JOIN {users} u ON w.uid = u.uid"; + $sql = "SELECT w.wid, w.uid, w.severity, w.type, w.timestamp, w.message, w.variables, w.link, w.server_addr, w.server_name, u.name FROM {watchdog} w INNER JOIN {users} u ON w.uid = u.uid"; $tablesort = tablesort_sql($header); if (!empty($filter['where'])) { $result = pager_query($sql ." WHERE ". $filter['where'] . $tablesort, 50, 0, NULL, $filter['args']); @@ -80,6 +81,7 @@ format_date($dblog->timestamp, 'small'), l(truncate_utf8(_dblog_format_message($dblog), 56, TRUE, TRUE), 'admin/reports/event/'. $dblog->wid, array('html' => TRUE)), theme('username', $dblog), + $dblog->server_addr . ' (' . $dblog->server_name. ')', $dblog->link, ), // Attributes for tr @@ -170,6 +172,14 @@ array('data' => t('Operations'), 'header' => TRUE), $dblog->link, ), + array( + array('data' => t('Server IP'), 'header' => TRUE), + $dblog->server_addr, + ), + array( + array('data' => t('Server Name'), 'header' => TRUE), + $dblog->server_name, + ), ); $attributes = array('class' => 'dblog-event'); $output = theme('table', array(), $rows, $attributes); Index: modules/dblog/dblog.install =================================================================== --- modules/dblog/dblog.install (revision 66) +++ modules/dblog/dblog.install (working copy) @@ -92,6 +92,20 @@ 'default' => 0, 'description' => 'Unix timestamp of when event occurred.', ), + 'server_addr' => array( + 'type' => 'varchar', + 'length' => 128, + 'not null' => TRUE, + 'default' => '', + 'description' => 'IP address of the server who triggered the event.', + ), + 'server_name' => array( + 'type' => 'varchar', + 'length' => 255, + 'not null' => TRUE, + 'default' => '', + 'description' => 'Name of the server who triggered the event.', + ), ), 'primary key' => array('wid'), 'indexes' => array('type' => array('type')), @@ -115,6 +129,16 @@ } /** + * Add new fields server_addr and server_name. + */ +function dblog_update_6001() { + $ret = array(); + db_add_field($ret, 'watchdog', 'server_addr', array('type' => 'varchar', 'length' => 128, 'not null' => TRUE, 'default' => '', 'description' => 'IP address of the server who triggered the event.', 'initial' => '')); + db_add_field($ret, 'watchdog', 'server_name', array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => '', 'description' => 'Name of the server who triggered the event.', 'initial' => '')); + return $ret; +} + +/** * @} End of "defgroup updates-6.x-extra" * The next series of updates should start at 7000. */ Index: modules/dblog/dblog.module =================================================================== --- modules/dblog/dblog.module (revision 66) +++ modules/dblog/dblog.module (working copy) @@ -129,9 +129,9 @@ function dblog_watchdog($log = array()) { $current_db = db_set_active(); db_query("INSERT INTO {watchdog} - (uid, type, message, variables, severity, link, location, referer, hostname, timestamp) + (uid, type, message, variables, severity, link, location, referer, hostname, timestamp, server_addr, server_name) VALUES - (%d, '%s', '%s', '%s', %d, '%s', '%s', '%s', '%s', %d)", + (%d, '%s', '%s', '%s', %d, '%s', '%s', '%s', '%s', %d, '%s', '%s')", $log['user']->uid, $log['type'], $log['message'], @@ -141,7 +141,10 @@ $log['request_uri'], $log['referer'], $log['ip'], - $log['timestamp']); + $log['timestamp'], + $log['server_addr'], + $log['server_name'] + ); if ($current_db) { db_set_active($current_db); Index: modules/syslog/syslog.module =================================================================== --- modules/syslog/syslog.module (revision 66) +++ modules/syslog/syslog.module (working copy) @@ -96,6 +96,8 @@ global $base_url; $message = $base_url; + $message .= '|'. $entry['server_addr']; + $message .= '|'. $entry['server_name']; $message .= '|'. $entry['timestamp']; $message .= '|'. $entry['type']; $message .= '|'. $entry['ip'];