Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

nodejs newrelic throws Error: EACCES, open '/newrelic_agent.log'

I just tried to get newrelic tracking on my node app working (http://newrelic.com/nodejs), however I get the following error:

events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: EACCES, open '/newrelic_agent.log'

According to newrelic node is logging to the same directory. However this seems to me that it is trying to log to the root directory?!

Manually creating the file in the server root works. However this isn't what I like to do. Is this a bug?

How can I set the log path?

like image 577
Manuel Avatar asked Aug 08 '14 20:08

Manuel


1 Answers

You can change your log path in your newrelic.js configuration file.

logging : {
  filepath : 'log_path_here'
}

Or

You can set the log path with an environment variable. You an use the NEW_RELIC_LOG environment variable.

Environment variables override settings made in the newrelic.js config file.

like image 181
user1816629 Avatar answered Oct 16 '22 07:10

user1816629