Permalink
Browse files

filestore-streams: also log timestamp for each stream

  • Loading branch information...
Georg Wicherski
Georg Wicherski committed Nov 23, 2011
1 parent c104872 commit 4884f9d3da613582601d2f8cc8ddf5ffe79cca45
Showing with 3 additions and 0 deletions.
  1. +3 −0 src/filestore-streams/filestore-streams.cpp
@@ -103,11 +103,14 @@ void FileStoreStreamsModule::handleEvent(Event * event)
const basic_string<uint8_t>& data =
recorder->getStreamData(k);
stringstream prefix;
strftime(dateBuffer, sizeof(dateBuffer), "%F %T %z", ::localtime_r(&now, &localtime));
prefix << "{\"source\":\"" << recorder->getSource().name << ':' << recorder->getSource().port
<< "\",\"destination\":\"" << recorder->getDestination().name << ':'
<< recorder->getDestination().port << "\",\"direction\":\""
<< (k == StreamRecorder::DIR_INCOMING ? "in" : "out")
<< "\",\"ts\":\"" << dateBuffer
<< "\",\"data\":\"";
if((fd = open(filename.c_str(), O_CREAT | O_WRONLY | O_APPEND, S_IRUSR | S_IWUSR | S_IRGRP)) < 0)

0 comments on commit 4884f9d

Please sign in to comment.