title: Log files vs database where to save user activity data for analysis?
body: <p>I am currently working on a website which have functionality of login. I need to track user activities like time of login-logout, total duration of browsing, IP Address , location etc. This all data will be used for analysis and security purposes. </p>
  
  <p>Now , there are two options (at least i know) to save such a huge data either in database or in log files. </p>
  
  <p>What is right thing to do save in DB or in logs? . </p>
  
  <p>In case anyone wants to know, i am using using <strong>PHP</strong> as programming language and <strong>MySQL</strong> as DB and don't have any experience in data analysis.</p>