diff --git README.txt README.txt
old mode 100644
new mode 100755
index 7c33256..c289b47
--- README.txt
+++ README.txt
@@ -13,6 +13,13 @@ Features
 
 This module provides simple integration with the Apache log4php library.
 
+WARNING
+-------
+
+If you plan to view your log messages in a browser interface please use the
+LoggerRendererDrupalStandardObject renderer. Messages logged by other renderers are not passed through Drupal's
+check_plain() function and thus represent a security vector when viewed in a browser.
+
 
 Requirements
 ------------
diff --git log4php.info log4php.info
old mode 100644
new mode 100755
index 5b3f485..bfa9296
--- log4php.info
+++ log4php.info
@@ -1,3 +1,7 @@
 name = Apache log4php
 description = Logs and records system events to <a href="http://logging.apache.org/log4php/">Apache log4php</a>.
 core = 7.x
+files[] = includes/LoggerRendererDrupalLogObject.inc
+files[] = includes/LoggerRendererDrupalPlainLocaleObject.inc
+files[] = includes/LoggerRendererDrupalPlainObject.inc
+files[] = includes/LoggerRendererDrupalStandardObject.inc
diff --git log4php.module log4php.module
old mode 100644
new mode 100755
index 8b54096..a83e634
--- log4php.module
+++ log4php.module
@@ -17,20 +17,13 @@ function log4php_watchdog(array $log_entry) {
     require_once($logger_path);
     Logger::configure($conf['log4php_config']);
   }
-  
+
   $logger = Logger::getLogger('drupal:' . $log_entry['type']);
-  
-  // Construct plain-text message
-  $msg = array(
-    $log_entry['user']->uid > 0 ? $log_entry['user']->name : t('Anonymous'),
-    $log_entry['request_uri'],
-    $log_entry['ip'],
-    strip_tags(t($log_entry['message'], is_array($log_entry['variables']) ? $log_entry['variables'] : array())),
-  );
+
+  $log_object = LoggerRendererDrupalLogObject::getInstanceFromLogEntry($log_entry);
 
   // Allow other modules to change the format
-  drupal_alter('log4php', $msg, $log_entry);
-  $msg = implode(' ', $msg);
+  drupal_alter('log4php', $log_object);
 
   // Map Drupal severity levels to log4php levels
   // (Drupal currently has no analog to TRACE)
@@ -38,20 +31,20 @@ function log4php_watchdog(array $log_entry) {
     case WATCHDOG_EMERGENCY:
     case WATCHDOG_ALERT:
     case WATCHDOG_CRITICAL:
-      $logger->fatal($msg);
+      $logger->fatal($log_object);
       break;
     case WATCHDOG_ERROR:
-      $logger->error($msg);
+      $logger->error($log_object);
       break;
     case WATCHDOG_WARNING:
-      $logger->warn($msg);
+      $logger->warn($log_object);
       break;
     case WATCHDOG_NOTICE:
     case WATCHDOG_INFO:
-      $logger->info($msg);
+      $logger->info($log_object);
       break;
     case WATCHDOG_DEBUG:
-      $logger->debug($msg);
+      $logger->debug($log_object);
       break;
   }
 }
@@ -79,3 +72,47 @@ function _log4php_get_path() {
 
   return isset($path) ? $path : NULL;
 }
+
+/**
+ * Mostly a clone of t function which uses format_string() to sanitize log messages
+ * that are being shows in a page. We don't want that but we do need translation support
+ *
+ * @param $string
+ * @param array $args
+ * @param array $options
+ * @return array|null|string
+ */
+function log4php_t($string, array $args = array(), array $options = array()) {
+  global $language;
+  static $custom_strings;
+
+  // Merge in default.
+  if (empty($options['langcode'])) {
+    $options['langcode'] = isset($language->language) ? $language->language : 'en';
+  }
+  if (empty($options['context'])) {
+    $options['context'] = '';
+  }
+
+  // First, check for an array of customized strings. If present, use the array
+  // *instead of* database lookups. This is a high performance way to provide a
+  // handful of string replacements. See settings.php for examples.
+  // Cache the $custom_strings variable to improve performance.
+  if (!isset($custom_strings[$options['langcode']])) {
+    $custom_strings[$options['langcode']] = variable_get('locale_custom_strings_' . $options['langcode'], array());
+  }
+  // Custom strings work for English too, even if locale module is disabled.
+  if (isset($custom_strings[$options['langcode']][$options['context']][$string])) {
+    $string = $custom_strings[$options['langcode']][$options['context']][$string];
+  }
+  // Translate with locale module if enabled.
+  elseif ($options['langcode'] != 'en' && function_exists('locale')) {
+    $string = locale($string, $options['context'], $options['langcode']);
+  }
+  if (empty($args)) {
+    return $string;
+  }
+  else {
+    return strtr($string, $args);
+  }
+}
diff --git log4php.xml log4php.xml
old mode 100644
new mode 100755
index 2cf21a9..6d52f19
--- log4php.xml
+++ log4php.xml
@@ -1,5 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <configuration xmlns="http://logging.apache.org/log4php/">
+
+    <renderer renderedClass="LoggerRendererDrupalLogObject" renderingClass="LoggerRendererDrupalPlainLocaleObject" />
+
     <appender name="file" class="LoggerAppenderFile">
         <layout class="LoggerLayoutPattern" />
         <param name="file" value="/tmp/log4php.log" />
