Log response errors to a separate file

Hello, I would like to log to the general access log and also to a
log 404, 403, 500, 501, 502, 503 responses. Is there a way of doing
this? Is
anyone doing this?

Currently nginx is running in front of fastcgi and I would like 404 to
handled by the fastcgi backend (front controller pattern).