Answers.Body: <p>Yes you can delete/truncate the log tables. It's not used for anything except the change log / manual investigations.</p>
  <p>That post you linked to answers your second question: <code>DELETE FROM log_civicrm_XXX WHERE log_date &lt; DATE_SUB(NOW(), INTERVAL 3 MONTH)</code></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-08-17T12:03:30.543Z
Answers.LastActivityDate: 2023-08-17T12:03:30.543Z
Answers.UserDisplayName: Demerit
Body: <p>I've got detailed logging turned on, and everything is getting stored in a separate DB, but it's getting pretty big. Is it OK simply to truncate the tables? Clearly I'll lose the data, and the ability to roll back changes, but I need to keep the size of the database under some sort of control.
  If so, how could I delete everything older than say, the last 3 months? <a href="https://civicrm.stackexchange.com/questions/28920/is-there-a-process-to-tidy-the-tables-created-by-logging">This post</a> offers some clues on that.</p>
  
Tags: <db-logging>
Title: Is it OK to truncate log tables?
ThreadText: # Is it OK to truncate log tables?
  
  (Asked by: username_0 on 2023-08-17)
  
  I've got detailed logging turned on, and everything is getting stored in a separate DB, but it's getting pretty big. Is it OK simply to truncate the tables? Clearly I'll lose the data, and the ability to roll back changes, but I need to keep the size of the database under some sort of control.
  If so, how could I delete everything older than say, the last 3 months? [This post](https://civicrm.stackexchange.com/questions/28920/is-there-a-process-to-tidy-the-tables-created-by-logging) offers some clues on that.
  
  **Tags:** db-logging
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2023-08-17. Score: 2 | Accepted answer
  
  Yes you can delete/truncate the log tables. It's not used for anything except the change log / manual investigations.
  
  That post you linked to answers your second question: `DELETE FROM log_civicrm_XXX WHERE log_date < DATE_SUB(NOW(), INTERVAL 3 MONTH)`
  
  
  ---
  
  