title: C++, server-side logging multiply files at once
body: <p>I do have a 2D game server written in C++ that can host up to 1000 players (that limit is because of map size, not by a performance by any means). </p>
  
  <p>It's optimization and so is more-or-less great, as it was written by some really good developers.</p>
  
  <p>What I am now trying to do, is to attach logging for each and every player. I do want to log such actions like:
  Move things within, talks, die, login and so on and so on (so basically not everything, but fairly bit of what the player is doing)</p>
  
  <p>I am not having problem programming-wise, rather I do lack knowledge about how to (performance) handle it and if my attempt is any good. What I am trying to do right now is:</p>
  
  <p>I, for some reason, thought that it would be good to have each player log save to different files using ofstream.open. (I do believe that's an actually bad idea, <strong>but (1.) is it really? (2.) And why is it so? (3.) Can it handle up to 1000 files open?</strong>) I do have a class LoggingPlayer; on player login, I create an instance of this class and follow players actions by sending information to logging function.
  I do save write to file when the buffer's full. I do close file only when player logs-off. 
  <strong>If I lose file - that's not the big deal, really. If the server crashes or slows for few seconds - that's a big deal for me.</strong></p>
  
  <p>I do have a few questions regarding:</p>
  
  <p><strong>(4.) How can I make it better?</strong> (e.g. using one logger for all players? log in one file?)</p>
  
  <p><strong>(5.) Should I totally abandon trying to make my own logger</strong> and try the already existing ones? </p>
  
  <p><strong>(5a.)</strong> If so, <strong>what are the recommendations for such a case?</strong> (online with 500-1000 users). I heard about boost log, but never tried.</p>
  
  <p>I do appreciate all the help; so if you know the answer just for the one question, please don't hesitate.</p>