sql and logs