Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

newrelic creates huge log files on server

I faced with server disk overflow in couple days. Before it was full by 10%. The reason is files newrelic_agent.log files with size 5 - 30 giga bytes. I found such big files in nginx folder site-enabled and in home directories of node.js express applications.

{"name":"newrelic","hostname":"hostname","pid":355,"component":"redis","level":10,"msg":"Adding Redis command trace segment transaction 2769.","time":"2014-01-02T06:20:11.894Z","v":0}
{"name":"newrelic","hostname":"hostname","pid":355,"component":"redis","level":10,"msg":"Adding Redis command trace segment transaction 2769.","time":"2014-01-02T06:20:11.894Z","v":0}
{"name":"newrelic","hostname":"hostname","pid":355,"component":"redis","level":10,"msg":"Adding Redis command trace segment transaction 2769.","time":"2014-01-02T06:20:11.895Z","v":0}

After I delete these files I found them again in a day with such terrible size.

How to disable this logging on server? I think this is because of pivotal plugin for newrelic redis. Or the only way is to turn off this plugin?

like image 423
Maxim Yefremov Avatar asked Dec 20 '22 19:12

Maxim Yefremov


2 Answers

The best way to find out about configuration options including logging level is to check with the publisher of the plugin.

In this case it appears that verbose logging is enabled by default. You can turn down the logging by placing a # before verbose: 1 in the configuration file config/newrelic_plugin.yml.

Additionally you should consider running a log management application such as logrotate on your server to prevent file growth of this nature.

  • Logrotate man page
  • Logrotate examples
like image 105
Steven Avatar answered Dec 29 '22 00:12

Steven


There's an option to limit the log size by changing newrelic.yml:

 log_limit_in_kbytes: <put here limit in KB>

Notice the comment: # The log_file_count must be set greater than 1.

You must also limit the file count:

 log_file_count: <2 or more>
like image 20
user7294900 Avatar answered Dec 29 '22 00:12

user7294900