An assembly comprising a drug delivery device and a logging module adapted to create a log of expelled dose amounts of drug, the logging module being adapted to be mounted on the drug delivery device from a fully un-mounted to a fully mounted position along a path, the drug delivery device comprising: - a drug reservoir or means for receiving a drug reservoir, - dose setting means, and - drug expelling means for expelling a set dose, the logging module comprising electronic circuitry (420, 425) comprising: - sensor means adapted to capture a property value related to a dose amount of drug expelled from a reservoir by the expelling means during an expelling event, - processor means adapted to determine dose amounts based on captured property values, - a switch operatable between an off- and an on-state when the logging module is mounted on the drug delivery device, the switch being in the on-state when the logging module is mounted within a first distance from the fully mounted position, and in the off-state when the logging module is mounted outside the first distance from the fully mounted position, and the assembly comprising: - a snap lock (460, 212) comprising co-operating mating structures arranged on the logging module respectively the drug delivery device, the snap lock being operatable from an initial state through an expanded state to a snap-in state when the logging module is mounted on the drug delivery device, the snap lock being in the snap-in state when the logging module is mounted within a second distance from the fully mounted position, characterized in that - the second distance is shorter than the first distance to ensure that the switch will be in the on-state before the snap lock is in the snap-in state, - the electronic circuitry with the switch in the on-state is adapted to detect an error condition corresponding to a state in which the logging module is not in a mounted position with the snap lock in the snap-in state, and - the drug expelling means comprises a magnet having an initial axial position corresponding to a dose setting state, the electronic circuitry being adapted to detect the error condition based on a detected axial position of the magnet. - a drug reservoir or means for receiving a drug reservoir, - dose setting means, and - drug expelling means for expelling a set dose, - sensor means adapted to capture a property value related to a dose amount of drug expelled from a reservoir by the expelling means during an expelling event, - processor means adapted to determine dose amounts based on captured property values, - a switch operatable between an off- and an on-state when the logging module is mounted on the drug delivery device, the switch being in the on-state when the logging module is mounted within a first distance from the fully mounted position, and in the off-state when the logging module is mounted outside the first distance from the fully mounted position, and - a snap lock (460, 212) comprising co-operating mating structures arranged on the logging module respectively the drug delivery device, the snap lock being operatable from an initial state through an expanded state to a snap-in state when the logging module is mounted on the drug delivery device, the snap lock being in the snap-in state when the logging module is mounted within a second distance from the fully mounted position, characterized in that - the second distance is shorter than the first distance to ensure that the switch will be in the on-state before the snap lock is in the snap-in state, - the electronic circuitry with the switch in the on-state is adapted to detect an error condition corresponding to a state in which the logging module is not in a mounted position with the snap lock in the snap-in state, and - the drug expelling means comprises a magnet having an initial axial position corresponding to a dose setting state, the electronic circuitry being adapted to detect the error condition based on a detected axial position of the magnet.