diff --git a/lib/SimpleSAML/Logger.php b/lib/SimpleSAML/Logger.php
index 6aaadc73f166210ca9942ae4cba8b023798c82bc..f786ccb1657ce29c92a96c06d1d2b5c9e2f53beb 100644
--- a/lib/SimpleSAML/Logger.php
+++ b/lib/SimpleSAML/Logger.php
@@ -171,7 +171,12 @@ class SimpleSAML_Logger {
 		}
 
 		
-		if (self::$captureLog) self::$capturedLog[] = $string;
+		if (self::$captureLog) {
+			$ts = microtime(TRUE);
+			$msecs = (int)(($ts - (int)$ts) * 1000);
+			$ts = GMdate('H:i:s', $ts) . sprintf('.%03d', $msecs) . 'Z';
+			self::$capturedLog[] = $ts . ' ' . $string;
+		}
 		
 		if (self::$logLevel >= $level || $statsLog) {
 			if (is_array($string)) $string = implode(",",$string);