title: What's the most efficient file logging in a server written in C?
body: <p>I wonder what the most efficient file logging strategy would be in a server written in C?</p>
  
  <p>I can see the following options:</p>
  
  <ul>
  <li><p>fopen() append and then fwrite() the data for a time frame of say 1 hour, then fclose()?</p></li>
  <li><p>Caching the data and then occasionally open() append write() and close()?</p></li>
  </ul>