title: How to introduce date and time in log file
body: <p>I have one daemon written in C. I am logging the events in a log file, but now I want to add date and time while writing event to log file. How can I achieve that?</p>
  
  <p>Current log file:-</p>
  
  <pre><code>Event one occurred: result:
  Event two occurred: result:
  </code></pre>
  
  <p>I want the log file to look like:-</p>
  
  <pre><code>Sep 14 11:35:55 Event one occurred: result:
  Sep 14 11:35:55 Event two occurred: result:
  </code></pre>
  
  <p>My environment is C and Linux.</p>