There is provided a method for logging injections of a medicament carried out by a medical device with injection means comprising the steps of a) determining the amount of medicament that was ejected by the medical device, b) storing, in the memory of the device, the time of ejection together with data from a) as an ejection event, c) determining, with a proximity sensor in the device, said proximity sensor able to sense the proximity of a solid object in the direction of the injection needle, if ejection by the medical device takes place in the proximity of a solid object, and d) tagging the ejection event as an injection event if the ejection takes place in the proximity of a solid object and tagging the ejection event as a priming event if the ejection does not take place in the proximity of a solid object.