Log network in SQL + fix for non UTF8 encoding