A drug delivery assembly comprises a drug delivery device, an electronic dose logging module releasably attachable to the drug delivery device, and a cap releasably attachable to the logging module to cover an outlet portion of a mounted drug reservoir. The logging module and the drug delivery device comprise mating snap coupling means. The logging module comprises locking means acting on the locking module snap coupling means, wherein the locking means is actuated from the unlocked to the locked state when the cap is attached to the logging module in a first direction, and the locking means is actuated from the locked to the unlocked state when the cap is detached from the logging module in a second direction opposed to the first direction.