select_dbi_layout function

Automatically select appropriate layout for logging to a database