Logging SQL injection attempts involves tracking any time a hacker tries to exploit vulnerabilities in a database through malicious SQL code. The logs would capture the date, time, IP address, and details of the attempted injection. This information can then be analyzed to identify patterns or repeat attackers seeking unauthorized access to sensitive data stored in the database.