declare
client_ip varchar2(20);
begin
client_ip := select statement to get IP address
insert into table_name (IP) values (:client_ip);
Use the utl_file utility to write to a log file
end;