EmonScripts icon indicating copy to clipboard operation
EmonScripts copied to clipboard

Rotated logs review

Open TrystanLea opened this issue 6 years ago • 7 comments

Screenshots of my rotated logs based on the logrotate and log2ram configuration on the present release (https://github.com/openenergymonitor/EmonScripts/tree/master/defaults/etc/logrotate.d):

rotated_logs

rotated_logs_emoncms

rotated_logs_emonhub

Is this number of rotated logs based on the 100k rotation unwieldy? too many files to open and work through, if you wanted to find an error?

TrystanLea avatar Aug 07 '19 07:08 TrystanLea

Both the emonhub and emoncms logrotate config drop-ins should have their own maxsize= settings.

Even 1M was always way too small for emonhub, 3-5M maybe?

and the apache logs should also be getting sent to emoncms log folder by the vhost and then being rotated at the higher maxsize into /var/log.old/emoncms. Why are they in /var/log.old?

pb66 avatar Aug 11 '19 10:08 pb66

Hmm I'm not sure why the apache logs are there, the vhost settings direct them to /var/log/emoncms and they are also there - though not gzip'ed..

quite a few files over 100k too..

image

TrystanLea avatar Aug 23 '19 15:08 TrystanLea

File permissions where wrong on 00_defaults

TrystanLea avatar Aug 23 '19 20:08 TrystanLea

The apache2 log not in the emoncms folder is created by this entry in conf-enabled:

image

TrystanLea avatar Aug 23 '19 21:08 TrystanLea

I've changed it to /var/log/emoncms/apache2-error.log there for now and fixed the permissions on 00_defaults

TrystanLea avatar Aug 23 '19 21:08 TrystanLea

I've changed the maxsize on emoncms and emonhub logs to 3M

TrystanLea avatar Aug 25 '19 06:08 TrystanLea

I've changed it to /var/log/emoncms/apache2-error.log there for now

That sounds like it's the right place to set the default error log on an emonSD permanently.

fixed the permissions on 00_defaults

What is "00_defaults" ?

[edit] Ah! I've found it! I think that name (and maybe some others) are a bit vague. granted it might make slightly more sense whilst located in the logrotate.d folder, but even then it should be maybe "00-emonsd" because it is the emonSD global logrotate conf file. (looking at some other drop-in files the theme seems to be hyphens rather than underscores when prefixing a number), this file may become superfluous if the L2R drop-in defines a global along the same lines, which I suspect it will, I just haven't tackled the extended logrotate in any depth yet.

pb66 avatar Aug 25 '19 18:08 pb66