Thursday, April 12, 2012

Using SYSLOG to debug Web Apps

syslog(LOG_DEBUG, sprintf("thisfx is going is going to add %s ",
$_value));
db->query($thisinsertSQL);
syslog(LOG_DEBUG, sprintf("thisfx added %s ", $_value));
catch (PDOException $_e)
syslog(LOG_DEBUG, sprintf("thisfx failed to add %s ", $_value));

Finding SYSLOG
Recent
[root@server]# tail -f /var/log/messages
Apr 12 11:07:01 server httpd[506]: ....
^C
Specific
[root@server]# grep -i thisfx /var/log/messages
[root@server]# grep -i "thisfx added" /var/log/messages
[root@server]# grep -i "thisfx failed" /var/log/messages

No comments: