A logging device (100, 300) adapted to be releasably attached to a drug delivery device, the drug delivery device comprising a drug reservoir or means for receiving a drug reservoir, the drug reservoir comprising an outlet portion, a detachable cap adapted to cover the drug reservoir outlet portion in a mounted position, and drug expelling means comprising dose setting means allowing a user to set a dose amount of drug to be expelled, the logging device comprising: - electronic circuitry 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 when the logging device has been attached to a drug delivery device, - processor means adapted to determine dose amounts based on captured property values, - memory means adapted to store at least one dose amount, - display means (130, 360) adapted to display (i) a determined dose amount and/or a time value, and (ii) a warning message, and - switch means adapted to be operated, when the logging device has been attached to a drug delivery device, between an off-state when the cap is in the mounted position and an on-state when the cap has been detached, wherein: - the sensor means is turned on when the switch is operated from the off- to the on-state, and - the sensor means is turned off when the switch is operated from the on- to the off-state, characterized in that - the sensor means is turned off automatically when a predetermined amount of time has lapsed, and - the display means is turned on to display a warning message when the switch is operated from the on- to the off-state and the sensor means has been turned off automatically, the warning message indicating to a user that an expelled dose may not have been captured. - electronic circuitry 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 when the logging device has been attached to a drug delivery device, - processor means adapted to determine dose amounts based on captured property values, - memory means adapted to store at least one dose amount, - display means (130, 360) adapted to display (i) a determined dose amount and/or a time value, and (ii) a warning message, and - switch means adapted to be operated, when the logging device has been attached to a drug delivery device, between an off-state when the cap is in the mounted position and an on-state when the cap has been detached, - 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 when the logging device has been attached to a drug delivery device, - processor means adapted to determine dose amounts based on captured property values, - memory means adapted to store at least one dose amount, - display means (130, 360) adapted to display (i) a determined dose amount and/or a time value, and (ii) a warning message, and - switch means adapted to be operated, when the logging device has been attached to a drug delivery device, between an off-state when the cap is in the mounted position and an on-state when the cap has been detached, - the sensor means is turned on when the switch is operated from the off- to the on-state, and - the sensor means is turned off when the switch is operated from the on- to the off-state, characterized in that - the sensor means is turned off automatically when a predetermined amount of time has lapsed, and - the display means is turned on to display a warning message when the switch is operated from the on- to the off-state and the sensor means has been turned off automatically, the warning message indicating to a user that an expelled dose may not have been captured.