There is a module for that now [DBLog Filter][1]:

> DBLOG FILTER module allows you to store only filtered db log messages based on log type and log level.

[![enter image description here][2]][2]


  [1]: https://www.drupal.org/project/dblog_filter
  [2]: https://i.sstatic.net/gckNm.png