After numerous trolls on my server that would come back with a family shared account I decided to ban their IP. Well I couldn't do so without their actual IP. Yes I could take the long way and go through my console and then get it that way and then "ban ip XX.XX.XX.XX" but who has time for that! ULX comes ready to log IPs.

.
Here's how!
1) Navigate to your install of ULX ( Normally garrysmod>addon>ulx).
2) Nroceed further into the files (garrysmod>addon>ulx>lua>ulx>log.lua)
3) Open log.lua
4) Go to line 191, here you can see
local function playerInitialSpawn( ply )
local ip = ply:IPAddress()
local seconds = os.time() - (joinTimer[ip] or mapStartTime)
joinTimer[ip] = nil
local txt = string.format( "Client \"%s\" spawned in server <%s> (took %i seconds).", ply:Nick(), ply:SteamID(), seconds )
if logEvents:GetBool() then
ulx.logString( txt )
end
if logJoinLeaveEcho:GetBool() then
echoToAdmins( txt )
end
end
hook.Add( "PlayerInitialSpawn", "ULXLogInitialSpawn", playerInitialSpawn, HOOK_MONITOR_HIGH )
As you can see they still have the function left within ULX. Now it's just a matter of slightly editting the few lines of code to log IP addresses.
AS I have been unsuccessful with logging them this way I just editted a script to work just about the same way

Here for you want to take the easy way out.
hook.Add("PlayerInitialSpawn", "SaveIP", function( p )
if p:IPAddress() != nil then
file.Append("ips.txt", "Player "..p:Nick().." has connected from the IP: "..p:IPAddress().." and with the Steam ID: "..p:SteamID().."\n")
end
end)