title: Warning Unsafe statement written to the binary log using statement
body: <p>I've created a log system based on trigger.<br>
  Every time a row is inserted or updated the trigger store a new row in another table.   </p>
  
  <p>The trigger works fine but after some time I found this message in logs:</p>
  
  <p><code>[Warning] Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it invokes a trigger or a stored function that inserts into an AUTO_INCREMENT column. Inserted values cannot be logged correctly. Statement: update `gl_item` set `is_shown` = '0', `updated_at` = '2016-03-21 16:56:28' where `list_id` = '1' and `is_shown` = '1'
  </code></p>
  
  <p>I've already red some post related to this issue i like:<br>
  - <a href="https://stackoverflow.com/questions/16236535/mysql-replication-triggers">MySQL Replication &amp; Triggers</a>     </p>
  
  <p>But I don't understand the nature of the problem.</p>
  
  <p>What this warning mean?<br>
  I don't have to insert into auto increment column with triggers?<br>
  Which is the best way to create a log system in order to avoid this warning?   </p>
  
  <p><strong>Update</strong><br>
  Output of <code>SHOW CREATE TABLE</code>, this is the table where the trigger will enter THE rows.</p>
  
  <pre><code>gl_item_log | CREATE TABLE `gl_item_log` (
    `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Item log unique id',
    `item_id` bigint(20) unsigned DEFAULT NULL ,
    `updated_by` bigint(20) unsigned DEFAULT NULL ,
    `switch_shown` tinyint(4) DEFAULT NULL ,
    `switch_checked` tinyint(4) DEFAULT NULL ,
    `logged_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
    `logged_at_microtime` decimal(6,6) unsigned NOT NULL ,
    `logged_at_microtime_int` mediumint(8) unsigned NOT NULL DEFAULT '0' ,
    PRIMARY KEY (`id`),
    KEY `gl_item_log_updated_by_foreign` (`updated_by`),
    KEY `gl_item_log_item_id_updated_by_switch_shown_switch_checked_index` 
        (`item_id`,`updated_by`,`switch_shown`,`switch_checked`),
    CONSTRAINT `gl_item_log_item_id_foreign` 
        FOREIGN KEY (`item_id`) REFERENCES `gl_item` (`id`),
    CONSTRAINT `gl_item_log_updated_by_foreign` 
        FOREIGN KEY (`updated_by`) REFERENCES `gl_general_user` (`id`)
  ) ENGINE=InnoDB AUTO_INCREMENT=32 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
  </code></pre>
  
  <p>Could be a good idea drop the <code>id</code> column with the auto increment field in order to have logs entries without a unique identifier?</p>
  
  <p>Thanks        </p>