Allow the use of layout in configuration.

The use of targewithlayout allow the use of things like ${aspnet-user-identity} or ${exception}.
Merged changes from @ngraziano to support NLog layouts