why log_message is not displaying the message in log file
That's because the page will be redirected before logging the message.
Change the order of last two lines as follows:
log_message('error', 'Some variable did not contain a value.');redirect('projects/view/' . $bn->project_id);
Make sure that the threshold is set to log errors
Also it might help checking apache error logs
Make sure your log files are writeable.
See http://ellislab.com/codeigniter/user-guide/general/errors.html