title: log4j with MongoDb and best practice about saving the Log
body: <p>Using java and made a small test server to log incoming user connections. </p>
  
  <p>Adding the MongoDb as Databas and the log4j mongo appender log4j.properties<br>
  text file configured to save the Log class to Mongo.</p>
  
  <p>Everything is nice.</p>
  
  <p>I can now search among all Log Collections and trace a particular user based on the "message"</p>
  
  <p>I immediately thought that it could be cool to log each individual user event to respective UserData Collection Document.
  Users are also stored in the mongo as a UserData class Collection.</p>
  
  <p>Why i think about this is because its hard to trace user log activity if you have multiple threads all writing to the same Log Collection.</p>
  
  <p>When a user loggin i wanted to attach/append the user to a new Logger and let this logger live as long as user is on the server.</p>
  
  <p>Is this what the MongoDbPatternLayoutAppender is all about?<br>
  The documentations and tutorials about this is sparse maybe someone can explain?<br>
  Am i on the right track here? </p>
  
  <p>What's best to do?</p>