bind source

here is the bind source file for the client.c
in bind9 logs are written in var/log/file name in the form
02-Aug-2012 15:43:12.713 client 192.168.2.4#47512: query: 209.236.125.74.in-addr.arpa IN PTR + (192.168.2.4)
i am in a subnet of 10 systems through 192.168.2.1..10 i want to write logs based on the ip address in the files in the format filename.ipadress
there is a function called isc_log_write which is responsible for logging can any one help me know the behaviour of isc_log_write in client.c attached file
how is it writing the logsi have added a plugin in bind9 source which gets the ip address from the output string now in the final string.based on this ip i need to append it to filename( if my file name is named_querylog then the cooresponding logs of the ip will be in the file name as named_query.log.192.168.132.1
so i need to find out the behaviour of isc_log_write can you help me find out what is happening in this function?
what context it passes to log_write in the case where it logs peerbuf?
i am using bind 9.7.3 please reply its really important?

The code that appears to write, "isc_log_write", is not actually in that file.

sorry it was not attached properly to the thread i am attaching the code please check it