Nginx – How to simplify nginx error log

nginx

I want to simplify nginx error log but without success.
I'm executing in index.php this:

error_log('abc');

and I'm getting this error:

2016/08/22 16:11:57 [error] 5267#0: *4 FastCGI sent in stderr: "PHP message: abc" while reading response header from upstream, client: 192.168.1.12, server: domain.com, request: "GET /index.php HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "domain.com", referrer: "http://domain.com/"

while watching nginx error file:

tail -f /var/log/nginx/error.log

I have tried to edit /etc/nginx/nginx.conf + added

log_format vhosts 'test';

in http{ section but error message is still same.
I would like to get only "abc" in error.log file.

Thank you

Best Answer

log_format is for access_log. Something like:

tail -f /var/log/nginx/error.log | awk '{print $12}'

may do the trick but only if "abc" is a non-whitespace string.