diff --git a/include/ajax.content.php b/include/ajax.content.php
index 2451880ac8da4494fa44e690d07daa2926a4d7a8..d4846823987fa3ac66f289cb1ff3dc57cb420310 100644
--- a/include/ajax.content.php
+++ b/include/ajax.content.php
@@ -21,7 +21,9 @@ class ContentAjaxAPI extends AjaxController {
     function log($id) {
 
         if($id && ($log=Log::lookup($id))) {
-            $content=sprintf('<div style="width:500px;">&nbsp;<strong>%s</strong><br><p>%s</p>
+            $content=sprintf('<div
+                    style="width:500px;">&nbsp;<strong>%s</strong><br><p
+                    style="white-space:pre-line;">%s</p>
                     <hr><strong>Log Date:</strong> <em>%s</em> <strong>IP Address:</strong> <em>%s</em></div>',
                     $log->getTitle(),
                     Format::display(str_replace(',',', ',$log->getText())),
diff --git a/include/class.osticket.php b/include/class.osticket.php
index 839d36e4bb39f61499efe7e5917d1b04719a2576..875dc13bf8e2e6217a881db22448c0251a019cc5 100644
--- a/include/class.osticket.php
+++ b/include/class.osticket.php
@@ -271,7 +271,7 @@ class osTicket {
 
         $e = new Exception();
         $bt = str_replace(ROOT_DIR, '(root)/', $e->getTraceAsString());
-        $error .= "\n\n---- Backtrace ----\n".$bt;
+        $error .= nl2br("\n\n---- Backtrace ----\n".$bt);
 
         return $this->log(LOG_ERR, $title, $error, $alert);
     }