3

My sensu-client.log files are growing to ridiculous sizes like 1.7 GB plus and it is taking up a lot of unnecessary space.

Does anyone know how to set an option to limit the file size or have an additional suggestion to control this.

Thanks

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
user3001829
  • 24,412
  • 5
  • 17
  • 21

2 Answers2

4

You can configure sensu log level by setting LOG_LEVEL in /etc/default/sensu to either debug, info, warn or error.

You will need to restart the sensu-client (service sensu-client restart) after making the change.

Mike Lyons
  • 1,748
  • 2
  • 20
  • 33
  • 1
    I tried this setting the LOG_LEVEL=error in /etc/default/sensu and after restarting the service is still logs everything. Am I doing something wrong? – user3001829 Dec 08 '14 at 08:17
  • What kind of log entry do you have there ? – KrzysztofSzarek Dec 09 '14 at 09:10
  • {"timestamp":"2014-12-03T12:01:47.584546+0000","level":"info","message":"received check request","check":{"name":"memory_percent_check","issued":1417608107,"command":"/etc/sensu/plugins/system/check-memory-pcnt.sh -c 80 -w 70"}} {"timestamp":"2014-12-03T12:01:58.080922+0000","level":"warn","message":"received signal","signal":"TERM"} {"timestamp":"2014-12-03T12:01:58.081110+0000","level":"warn","message":"stopping"} {"timestamp":"2014-12-03T12:01:58.081379+0000","level":"info","message":"completing checks in progress","checks_in_progress":[]} – user3001829 Dec 10 '14 at 09:09
  • Do you know how I can fix that? – user3001829 Dec 22 '14 at 11:36
  • What kind of system do you have ? Ubuntu, CentOS or something else? – KrzysztofSzarek Dec 23 '14 at 13:46
1

In addition to @KrzysztofSzarek's answer, putting LOG_LEVEL=warn in /etc/default/sensu, you may also specify the log level on the command line when starting sensu-server/sensu-api/sensu-client, e.g. -L warn

See the corresponding code on Github.

Fabian Streitel
  • 2,702
  • 26
  • 36