Add logger. Improve extension regex.