What is a LDF file? A file with .ldf extension is a log file maintained by Microsoft SQL Server which is a relational database management system (RDBMS). All the transactions performed on primary database files (MDF)(such as insertion, update, deletion) are recorded in the LDF file. LDF files are critical components of any database. In case of a system failure, the log file is used to restore the database to a consistent state.