diff --git a/liblog/logd_write.c b/liblog/logd_write.c
index c3efc33..aa0ad39 100644
--- a/liblog/logd_write.c
+++ b/liblog/logd_write.c
@@ -111,11 +111,34 @@
          */
         return 0;
     }
-    struct iovec newVec[nr + 2];
+    /*
+     *  struct {
+     *      // what we provide
+     *      typeof_log_id_t  log_id;
+     *      u16              tid;
+     *      log_time         realtime;
+     *      // caller provides
+     *      union {
+     *          struct {
+     *              char     prio;
+     *              char     payload[];
+     *          } string;
+     *          struct {
+     *              uint32_t tag
+     *              char     payload[];
+     *          } binary;
+     *      };
+     *  };
+     */
+    static const unsigned header_length = 3;
+    struct iovec newVec[nr + header_length];
     typeof_log_id_t log_id_buf = log_id;
+    uint16_t tid = gettid();
 
     newVec[0].iov_base   = (unsigned char *) &log_id_buf;
     newVec[0].iov_len    = sizeof_log_id_t;
+    newVec[1].iov_base   = (unsigned char *) &tid;
+    newVec[1].iov_len    = sizeof(tid);
 
     struct timespec ts;
     clock_gettime(CLOCK_REALTIME, &ts);
@@ -123,17 +146,17 @@
     realtime_ts.tv_sec = ts.tv_sec;
     realtime_ts.tv_nsec = ts.tv_nsec;
 
-    newVec[1].iov_base   = (unsigned char *) &realtime_ts;
-    newVec[1].iov_len    = sizeof(log_time);
+    newVec[2].iov_base   = (unsigned char *) &realtime_ts;
+    newVec[2].iov_len    = sizeof(log_time);
 
     size_t i;
-    for (i = 2; i < nr + 2; i++) {
-        newVec[i].iov_base = vec[i-2].iov_base;
-        newVec[i].iov_len  = vec[i-2].iov_len;
+    for (i = header_length; i < nr + header_length; i++) {
+        newVec[i].iov_base = vec[i-header_length].iov_base;
+        newVec[i].iov_len  = vec[i-header_length].iov_len;
     }
 
     /* The write below could be lost, but will never block. */
-    return writev(logd_fd, newVec, nr + 2);
+    return writev(logd_fd, newVec, nr + header_length);
 #endif
 }
 
diff --git a/logd/LogBuffer.cpp b/logd/LogBuffer.cpp
index 197b7e8..1c5cef0 100644
--- a/logd/LogBuffer.cpp
+++ b/logd/LogBuffer.cpp
@@ -45,13 +45,13 @@
 }
 
 void LogBuffer::log(log_id_t log_id, log_time realtime,
-                    uid_t uid, pid_t pid, const char *msg,
-                    unsigned short len) {
+                    uid_t uid, pid_t pid, pid_t tid,
+                    const char *msg, unsigned short len) {
     if ((log_id >= LOG_ID_MAX) || (log_id < 0)) {
         return;
     }
     LogBufferElement *elem = new LogBufferElement(log_id, realtime,
-                                                  uid, pid, msg, len);
+                                                  uid, pid, tid, msg, len);
 
     pthread_mutex_lock(&mLogElementsLock);
 
diff --git a/logd/LogBuffer.h b/logd/LogBuffer.h
index 0745e56..cbbb2ce 100644
--- a/logd/LogBuffer.h
+++ b/logd/LogBuffer.h
@@ -48,7 +48,8 @@
     LogBuffer(LastLogTimes *times);
 
     void log(log_id_t log_id, log_time realtime,
-             uid_t uid, pid_t pid, const char *msg, unsigned short len);
+             uid_t uid, pid_t pid, pid_t tid,
+             const char *msg, unsigned short len);
     log_time flushTo(SocketClient *writer, const log_time start,
                      bool privileged,
                      bool (*filter)(const LogBufferElement *element, void *arg) = NULL,
diff --git a/logd/LogBufferElement.cpp b/logd/LogBufferElement.cpp
index 8d45f34..d959ceb 100644
--- a/logd/LogBufferElement.cpp
+++ b/logd/LogBufferElement.cpp
@@ -27,11 +27,12 @@
 const log_time LogBufferElement::FLUSH_ERROR((uint32_t)0, (uint32_t)0);
 
 LogBufferElement::LogBufferElement(log_id_t log_id, log_time realtime,
-                                   uid_t uid, pid_t pid, const char *msg,
-                                   unsigned short len)
+                                   uid_t uid, pid_t pid, pid_t tid,
+                                   const char *msg, unsigned short len)
         : mLogId(log_id)
         , mUid(uid)
         , mPid(pid)
+        , mTid(tid)
         , mMsgLen(len)
         , mMonotonicTime(CLOCK_MONOTONIC)
         , mRealTime(realtime) {
@@ -50,6 +51,7 @@
     entry.len = mMsgLen;
     entry.lid = mLogId;
     entry.pid = mPid;
+    entry.tid = mTid;
     entry.sec = mRealTime.tv_sec;
     entry.nsec = mRealTime.tv_nsec;
 
diff --git a/logd/LogBufferElement.h b/logd/LogBufferElement.h
index 1da09ae..fdca973 100644
--- a/logd/LogBufferElement.h
+++ b/logd/LogBufferElement.h
@@ -26,6 +26,7 @@
     const log_id_t mLogId;
     const uid_t mUid;
     const pid_t mPid;
+    const pid_t mTid;
     char *mMsg;
     const unsigned short mMsgLen;
     const log_time mMonotonicTime;
@@ -33,12 +34,14 @@
 
 public:
     LogBufferElement(log_id_t log_id, log_time realtime,
-                     uid_t uid, pid_t pid, const char *msg, unsigned short len);
+                     uid_t uid, pid_t pid, pid_t tid,
+                     const char *msg, unsigned short len);
     virtual ~LogBufferElement();
 
     log_id_t getLogId() const { return mLogId; }
     uid_t getUid(void) const { return mUid; }
     pid_t getPid(void) const { return mPid; }
+    pid_t getTid(void) const { return mTid; }
     unsigned short getMsgLen() const { return mMsgLen; }
     log_time getMonotonicTime(void) const { return mMonotonicTime; }
     log_time getRealTime(void) const { return mRealTime; }
diff --git a/logd/LogListener.cpp b/logd/LogListener.cpp
index 2aa2ebb..bef2097 100644
--- a/logd/LogListener.cpp
+++ b/logd/LogListener.cpp
@@ -50,7 +50,7 @@
     int socket = cli->getSocket();
 
     ssize_t n = recvmsg(socket, &hdr, 0);
-    if (n <= (ssize_t) sizeof_log_id_t) {
+    if (n <= (sizeof_log_id_t + sizeof(uint16_t) + sizeof(log_time))) {
         return false;
     }
 
@@ -82,17 +82,22 @@
     if (log_id < 0 || log_id >= LOG_ID_MAX) {
         return false;
     }
-
     char *msg = ((char *)buffer) + sizeof_log_id_t;
     n -= sizeof_log_id_t;
 
+    // second element is the thread id of the caller
+    pid_t tid = (pid_t) *((uint16_t *) msg);
+    msg += sizeof(uint16_t);
+    n -= sizeof(uint16_t);
+
+    // third element is the realtime at point of caller
     log_time realtime(msg);
     msg += sizeof(log_time);
     n -= sizeof(log_time);
 
     unsigned short len = n;
     if (len == n) {
-        logbuf->log(log_id, realtime, cred->uid, cred->pid, msg, len);
+        logbuf->log(log_id, realtime, cred->uid, cred->pid, tid, msg, len);
         reader->notifyNewLog();
     }
 
