Hi,
I have a Java application wich runs on two machines in a cluster and they both log to one mysql database. Everything works fine, but I would like to have an additional field in the database wich represents the IP where the requests is coming from.
I solved this by having two different log4j.properties files, but I guess there is a nicer way to do that?
This is the line in the log4j.properties file that is different on the machines:
log4j.appender.DB.sql=INSERT INTO log4j (date, category, priority, server, message) VALUES ('%d{dd MMM yyyy HH:mm:ss,SSS}','%c','%p','10.20.30.40','%m')
Is there something for mysql like connection_ip? Or a placeholder in log4j, so that I could store the IP in there from the Java application?
Cheers, Lukas