Export the function formatLogData() in module layout.js

We will create a custom appender that logs in the db. There we want to format the log message, but without any layout. So this pull request will help us to reuse your functionality instead of recreating the same logic in the appender.