diff --git a/logmongo.js b/logmongo.js
index <HASH>..<HASH> 100644
--- a/logmongo.js
+++ b/logmongo.js
@@ -1,5 +1,6 @@
 var mongoose = require('mongoose') 
   , Schema = mongoose.Schema
+  , util = require('util')
   ;
 
 exports.connect = function(dburl, callback) {
@@ -41,4 +42,17 @@ exports.forAll = function(doEach, done) {
     });
     done(null);
   });
+}
+
+exports.lastLog = function(type, callback){
+  Logger.findOne({ type: type }).sort("-ts").findOne(function(err, doc) {
+    if (err) {
+      util.log('FATAL '+ err);
+      callback(err, null);
+    }
+    if (doc===null){
+      doc = { name: new Date(), msg: "", type: 0 };
+    }
+    callback(err, doc);
+  });
 }
\ No newline at end of file
Added method to get last log entered by type