Does the flight data recorder record whether the cockpit door lock was deliberately used to lock someone out?
While it is not on the required parameters list, it would not surprise me if it would be recorded- most FDRs record considerably more than the 88 mandatory parameters, and cockpit doors are of course interesting in accident investigations.
That being said, it should also come across pretty evidently on the Cockpit Voice Recorder if somebody was trying to get in. The normal request is a pretty distinct buzzer and the emergency request is the same buzzer for 5 minutes unless denied/ cancelled by the pilot. The door also locks quite loudly. Both should be able to be picked up by the general area cockpit microphone.
ICAO Annex 6 part 1 (Appendix 8) lists parameters required to be recorded on digital flight data recorders. This should give you a general sense of what gets recorded, but cockpit door locking state is not among them.
The caveat to this is many of these might not be individually codified in regulation by member parties to the convention. Carriers are regulated by their state of registration. In the United States, cockpit door locking state is not one of the required parameters mandated by the FAA.
(The original answer specifically mentioned European regulations, but has since changed to a general question. My answer has been edited accordingly.)