5

This is similar to this question, which got no responses: How to debug CGI over fcgiwrap/nginx

How do I get perl errors to be automatically placed in the nginx error log? Right now, when there is any perl error, the following message goes in the error log:

2014/05/11 22:43:48 [error] 1730#0: *5 connect() failed (111: Connection refused) while connecting to upstream, client: localhost, server: localhost, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "localhost"

This is completely useless for debugging. I can use something like CGI::Carp qw{fatalsToBrowser}, but this is not optimal. It would be better to have it logged to a server-side file.

Bintz
  • 365
  • 1
  • 2
  • 10

1 Answers1

0

You can use this solution to send both STDOUT and STDERR to any log file you have access to write to, including your nginx error.log. Though it'd likely be more helpful to send it to a different file. Simply remove the STDOUT entries, if you only want STDERR output.

Jim Black
  • 266
  • 2
  • 12
  • Please provide the relevant content *here* and link elsewhere for more details (and for attribution). – EEAA Dec 29 '15 at 03:17