MIQ - Logs in /var/www/miq/vmdb/log


#1

Hi,

I’ve a question about Manageiq Logs, specially about top_output.log and evm.log.

There will be a problem if i clean this logs? Because they weight 6GB and 2GB. i installed manageiq only 3 weeks ago.

Thanks!


#2

Yes, it is ok to clean them. The best way might be to echo '' > evm.log so as not to remove the file out from the running system. However, I do have a couple questions.

  1. Those logs are enormous for only 3 weeks. Did you look inside and see any pattern of errors or problems? Perhaps you’ve uncovered a bug we don’t know about yet.
  2. I believe the logs should be log-rotated, so I would expect .zip files for the evm.log on some time basis. Do you see that? @bdunne @jrafanie Do you know if this is done and how frequently?

#3

No. The logs doesn’t rotate. And i not see any .zip file in that folder.

I will clean the logs and check the next week how much they weight. But i check the logs and i’m not seeing any errors.


#4

We’re using the default Rails logger, which doesn’t supports log rotation.
I think uncommenting line 39 in the vmdb/config/environments/production.rb file should solve this problem.
This way the logger inherits the system-wide logrotate configuration from /etc/logrotate.conf.


#5

That would only rotate the production.log, but we have multiple logs even outside our app. The log rotate config is here: https://github.com/ManageIQ/manageiq/blob/master/system/COPY/etc/logrotate.d/miq_logs.conf

Oddly I also see another custom logrotate script here: https://github.com/ManageIQ/manageiq/blob/master/system/logrotate_free_space_check.sh , but I don’t know why we have that.
EDIT: If I actually read the conf above, I would see it uses that script to check disk space free.

@gstaricco Are you using the pre-built appliance? If so, can you open a bug issue on the source repo about the logs no rotating? Thanks.


#6

I vaguely recall log rotate was broken a while ago because a script was failing a selinux policy. You’d see audit failures in the audit logs in /var/log.

Please search our github issues/pull requests as it should be fixed. If you’re using the anand release appliance, it might not have this fix.

Please provide your current git sha/ version… Try git show HEAD from the /var/www/miq directory as it will show the sha1 at the top. I believe we also show the version information in the UI in help-> about I believe.


#7

Well, after weekend i see that the log rotate start to work. Another sysadmin stop selinux the saturday. Maybe was that.

@Fryguy the logrotate started to work last saturday, how i said, i think that selinux was the problem. Anyway, I’ll open the bug issue because i use the pre-built appliance for rhevm


#8

@gstaricco I found the issue and pull request I was thinking about.

Note, the commit in the pull request is not in the anand release appliance, found here, so you’ll probably want to use a sprint/nightly build found here, apply the change manually or run the appliance from the master branch.


#9

Thanks. i modified the contexts of the selinux and now is working.


#11

Bug issue opened. #1973

The log rotate.d script in /etc/logrotate.d/miq_logs.conf its correct in my server

/var/www/miq/vmdb/log/*.log /var/www/miq/vmdb/log/apache/*.log /opt/rh/postgresql92/root/var/lib/pgsql/data/pg_log/postgresql.log {
  daily
  dateext
  missingok
  rotate 14
  notifempty
  compress
  copytruncate
  prerotate
    /bin/sh /var/www/miq/system/logrotate_free_space_check.sh $1
  endscript
  lastaction
    /sbin/service httpd reload > /dev/null 2>&1 || true
  endscript
}