Your DNS profile is what connects connects the DNS logging profile to the listener. The DNS logging profile uses a log publisher which uses a logging destination. All of which actually runs in LTM(tmm) even though it is attached to a DNS listener that is part of GTM. Very little of GTM actually runs in the gtmd process anymore(BIND still does that's why its not recommended to resolve DNS from on box BIND) as it is single threaded where as tmm runs using CMP. I highly recommend sticking with High Speed Logging via the profile, it will preform better than doing it wiht an iRule. Built in features are more highly optomized than iRules.