COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
httpd 1744 apache 16w REG 202,1 0 167906281 phpapi_access_log
httpd 2334 apache 16w REG 202,1 0 167906281 phpapi_access_log
Above is the output of lsof for my phpapi_access_log file. Logging frequency is very low so I cannot determine if logs are being written to the file or not. I enabled logrotate for the file, till now the file is empty. How can I verify logs will be written to the file when required? What is SIZE/OFF and why is it "0" ?
The offset is the position in your file (or the size of the file if it is appended). Since the file is empty it is 0. If the file is opened by Apache that part is configured correctly, so don't worry. The most common problem with logrotate is renaming a file without telling Apache.
In lsof you would see this as an open file with wrong (archived) name OR a file marked as (deleted). Both is not the case on your system.
You could check if you want to change the loglevel to write more or less info to the file, but that's not logrotate related.
Besides that, you can drop a PHP Script which triggers logging output. (Not sure what API you would have to call for phpapi_access log.
Since this question is tagged lsof, the manpage has a large chapter on each column: