Hide Forgot
Description of problem: There should be log management so log cannot grow into big files. I mean that there should be at least log rotation. I would like to recommend standard/preferred solution for RHEL 7. Version-Release number of selected component (if applicable): rhscon-ceph-0.0.6-14.el7.x86_64 rhscon-core-0.0.8-14.el7.x86_64 rhscon-ui-0.0.23-1.el7.noarch How reproducible: 100% Steps to Reproduce: 1. start skyring 2. wait some time and watch increasing of log files Actual results: Logs increase endlessly. QE use debug log level and increasing is faster but even if user has default log level(info) he will hit this issue after some time. Expected results: There is log rotation and other log management.
Additional info: we may consider systemd documentation suggestions on logging[1]: > Instead of using the syslog() call to log directly to the system syslog > service, a new-style daemon may choose to simply log to standard error via > fprintf(), which is then forwarded to syslog by the init system. If log levels > are necessary, these can be encoded by prefixing individual log lines with > strings like "<4>" (for log level 4 "WARNING" in the syslog priority scheme), > following a similar style as the Linux kernel's printk() level system. For > details, see sd-daemon(3) and systemd.exec(5). [1] see man 7 daemon or https://www.freedesktop.org/software/systemd/man/daemon.html Right now (rhscon-core-0.0.11-1.el7.x86_64), skyring handles writing into the logfile on his own. See: ~~~ # lsof /var/log/skyring/skyring.log COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME skyring 25185 root 1w REG 253,2 5478163 270876 /var/log/skyring/skyring.log skyring 25185 root 2w REG 253,2 5478163 270876 /var/log/skyring/skyring.log skyring 25185 root 4w REG 253,2 5478163 270876 /var/log/skyring/skyring.log skyring 25185 root 15w REG 253,2 5478163 270876 /var/log/skyring/skyring.log bigfin 25204 root 2w REG 253,2 5478163 270876 /var/log/skyring/skyring.log bigfin 25204 root 4w REG 253,2 5478163 270876 /var/log/skyring/skyring.log ~~~ Unfortunately, logging is not discussed in the systemd packaging policy[2], so I'm not sure what is actually required/enforced for a RHEL 7 service/daemon. [2] https://fedoraproject.org/wiki/Packaging:Systemd
We are using go-logging library for logging. I hope this does the job for us. We are planing to integrate with logrotate for log management
May I suggest that you simply log to STDOUT/STDERR (instead of files), so that logs to go into systemd-journald ? Then you get log rotation for free. See the rhscon-agent BZ 1335210 for details.
Log Rotation is implemented successfully for managing logfiles.
tested with ceph-ansible-1.0.5-31.el7scon.noarch ceph-installer-1.0.14-1.el7scon.noarch rhscon-ceph-0.0.34-1.el7scon.x86_64 rhscon-core-0.0.35-1.el7scon.x86_64 rhscon-core-selinux-0.0.35-1.el7scon.noarch rhscon-ui-0.0.49-1.el7scon.noarch and it works