       readBuffer buffer, read, contents, output, ->
         readLog fd, buffer, contents, size - read, output, callback
 
+writeExceptions = (exceptions, message) ->
+  exception = exceptions.shift()
+  process.stdout.write "  #{message} #{new Array((78 - message.length) / 2).join(" -")}\n"
+  if exception.location
+    location = exception.location
+    process.stdout.write "  #{location.file}:#{location.line}.\n"
+    process.stdout.write "  #{location.text}\n"
+    process.stdout.write "  #{new Array(location.column).join(" ")}^\n"
+  process.stdout.write "#{exception.message.replace(/^(\s*\S.*)$/mg, "  $1")}\n"
+  if exception.json
+    exception.json.stderr = "[Nested exception: See below.]" if exceptions.length
+    json = inspect(exception.json, false, 1000).replace(/^(\s*\S.*)$/mg, "    $1")
+    process.stdout.write "#{json}\n"
+  for element in exception.stack
+    process.stdout.write "    at #{element.method} (#{element.file})\n"
+  process.stdout.write "\n"
+  if exceptions.length
+    writeExceptions(exceptions, "Nested exception")
+              
 fs.open "/var/log/messages", "r", (error, fd) ->
   throw error if error
   buffer = new Buffer(1024 * 1024 * 64)

            process.stdout.write "#{header}\n\n"
            process.stdout.write "#{record.message}\n\n"
            if record.json
              if record.exception
                record.json.stderr = "[Uncaught exception: See below.]"
              json = inspect(record.json, 1000).replace(/^(\s*\S.*)$/mg, "  $1")
              process.stdout.write "#{json}\n\n"
            if record.exception
              process.stdout.write "  Uncaught exception - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n\n"
              if record.exception.location
                location = record.exception.location
                process.stdout.write "  #{location.file}:#{location.line}.\n"
                process.stdout.write "  #{location.text}\n"
                process.stdout.write "  #{new Array(location.column).join(" ")}^\n"
              process.stdout.write "#{record.exception.message.replace(/^(\s*\S.*)$/mg, "  $1")}\n\n"
              if record.exception.json
                json = inspect(record.exception.json, 1000).replace(/^(\s*\S.*)$/mg, "    $1")
                process.stdout.write "#{json}\n\n"
              for element in record.exception.stack
                process.stdout.write "    at #{element.method} (#{element.file})\n"
              process.stdout.write "\n"

          record.json = json
          record.jsonInvalid = true
        if record.json.stderr
          exceptions = []
          readExceptions(record.json.stderr, exceptions)
          record.exceptions = exceptions if exceptions.length > 0 

      output.unshift record
  if offset > 0 and output.length < options.lines
