Bug 1325340

Summary: log management missing
Product: Red Hat Storage Console Reporter: Martin Kudlej <mkudlej>
Component: coreAssignee: gowtham <gshanmug>
core sub component: configuration QA Contact: Martin Kudlej <mkudlej>
Status: CLOSED CURRENTRELEASE Docs Contact:
Severity: unspecified    
Priority: unspecified CC: kdreyer, mbukatov
Version: 2Keywords: TestBlocker
Target Milestone: ---   
Target Release: 2   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: rhscon-ceph-0.0.23-1.el7scon.x86_64, rhscon-core-0.0.24-1.el7scon.x86_64, rhscon-ui-0.0.39-1.el7scon.noarch Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-11-19 05:33:32 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On: 1338948    
Bug Blocks:    

Description Martin Kudlej 2016-04-08 13:21:05 UTC
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.

Comment 1 Martin Bukatovic 2016-04-20 08:35:29 UTC
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

Comment 3 Nishanth Thomas 2016-04-20 09:50:42 UTC
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

Comment 4 Ken Dreyer (Red Hat) 2016-05-11 16:23:33 UTC
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.

Comment 5 gowtham 2016-05-13 08:55:59 UTC
Log Rotation is implemented successfully for managing logfiles.

Comment 6 Martin Kudlej 2016-07-25 15:04:12 UTC
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