Is there a way to log login attempts in SQL Server, including machine name together with the machine IP address?
I read something about login triggers, but I don't know if it's useful for my needs.
You can enable Login auditing -- In SQL Server Management Studio, open SQL Server Properties > Security > Login Auditing.
There are four options available:
Once you click OK, settings will save and take effect after the restart of the service.
Once you've turned on auditing, the next step is to be able to find the results of auditing required. You can find this recorded in the SQL Server log.
On how to read the sql server log you can refer here..
In SQL server 2012 you can use SQL Server Extended Events to capture failed logins -
To set up Auditing using extended events and SQL server Audit you can read Using Extended Events to review SQL Server failed logins - -