To trace locks and deadlocks, you can write error messages to the event log of the server.  To do this use:-

DBCC TRACEON (1204,-1)

The 1204 is the event type to capture, for deadlocks you want to enable trace for 1204 and 1222.  A full list of event types can be found at

To disable trace use :-