Added an extension method to get a logger based on an instance type.