Bug 1306651

Summary: disable cinder logging in /var/log/messages on the controller node
Product: Red Hat OpenStack Reporter: Pratik Pravin Bandarkar <pbandark>
Component: openstack-cinderAssignee: Eric Harney <eharney>
Status: CLOSED ERRATA QA Contact: lkuchlan <lkuchlan>
Severity: medium Docs Contact:
Priority: low    
Version: 7.0 (Kilo)CC: eharney, nlevinki, pbandark, sgotliv, srevivo
Target Milestone: ---Keywords: Reopened, ZStream
Target Release: 7.0 (Kilo)   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: openstack-cinder-2015.1.3-4.el7ost Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1313893 (view as bug list) Environment:
Last Closed: 2016-04-26 15:30:10 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:    
Bug Blocks: 1313893    

Description Pratik Pravin Bandarkar 2016-02-11 14:15:15 UTC
Description of problem:
We deactivated the use of syslog in /etc/cinder/cinder.conf (use_syslog=False) on the controller nodes but we notice that cinder is still logging to `/var/log/messages`

Steps to reproduce :
1/ Set use_syslog=False in /etc/cinder/cinder.conf on the controller nodes

2/ Restart cinder services.

3/ Search for cinder logs in /var/log/messages :

[root@kilo1 ~]# grep -i cinder /var/log/messages |tail 
Feb 11 19:39:41 kilo1 cinder-volume: 2016-02-11 19:39:41.257 5263 INFO cinder.volume.manager [req-29e7a1c3-4aa3-47bb-9196-1d52b4e1e2c0 - - - - -] Updating volume status
Feb 11 19:40:11 kilo1 cinder-volume: 2016-02-11 19:40:11.457 5202 INFO cinder.volume.manager [req-e024a072-5e5a-4ca5-a841-a7596915b7a2 - - - - -] Updating volume status
Feb 11 19:40:27 kilo1 cinder-volume: 2016-02-11 19:40:27.481 5198 INFO cinder.volume.manager [req-d60c5210-f598-4942-a7c7-6e94ff9504dc - - - - -] Updating volume status
Feb 11 19:40:41 kilo1 cinder-volume: 2016-02-11 19:40:41.258 5263 INFO cinder.volume.manager [req-7b1cfc68-05a2-423a-a9ea-31b448778f4a - - - - -] Updating volume status
Feb 11 19:41:11 kilo1 cinder-volume: 2016-02-11 19:41:11.458 5202 INFO cinder.volume.manager [req-2fc90da1-987e-48ed-930b-c3d1d4c67ca5 - - - - -] Updating volume status
Feb 11 19:41:27 kilo1 cinder-volume: 2016-02-11 19:41:27.481 5198 INFO cinder.volume.manager [req-66a66ec0-18ca-4ec3-afe9-6887500b5c95 - - - - -] Updating volume status
Feb 11 19:41:41 kilo1 cinder-volume: 2016-02-11 19:41:41.256 5263 INFO cinder.volume.manager [req-015ec307-385d-4551-b10e-83a57bffee6e - - - - -] Updating volume status
Feb 11 19:42:11 kilo1 cinder-volume: 2016-02-11 19:42:11.460 5202 INFO cinder.volume.manager [req-8867e567-eb76-4e20-8f95-6be386ffbab5 - - - - -] Updating volume status
Feb 11 19:42:27 kilo1 cinder-volume: 2016-02-11 19:42:27.481 5198 INFO cinder.volume.manager [req-4f75eea7-bbcb-4a8d-aa81-0ed88e645412 - - - - -] Updating volume status
Feb 11 19:42:41 kilo1 cinder-volume: 2016-02-11 19:42:41.256 5263 INFO cinder.volume.manager [req-21e0eda4-fef0-41dc-b54b-214088b4027f - - - - -] Updating volume status


Version-Release number of selected component (if applicable):
RHOS6,RHOS7

How reproducible:
100%

Steps to Reproduce:
1.
2.
3.

Actual results:
cinder writes logs in `/var/log/messages`

Expected results:
No logs of Cinder in `/var/log/messages`

Additional info:

Comment 2 Eric Harney 2016-02-11 15:33:00 UTC
To not see logs in /var/log/messages, set use_stderr=False in cinder.conf.  This defaults to on, and the way our services are integrated with systemd means that stderr output is logged to syslog.  (For any OpenStack service, this isn't Cinder-specific.)

Comment 4 Sergey Gotliv 2016-02-24 12:55:46 UTC
Please, attach your /etc/cinder/cinder.conf.

Comment 5 Eric Harney 2016-02-24 19:02:18 UTC
Setting use_stderr=False fixes this for messages that come directly from Cinder.  But, there are some messages that come from dependencies of Cinder that may need to be handled with additional code.

For example, python-amqp issues messages with the "warnings" module.  It looks like we will need to use logging.captureWarnings() via oslo.logging or Cinder to reroute those messages.

The DeprecationWarning from oslo.i18n also falls in this category.

Comment 7 lkuchlan 2016-04-13 05:22:33 UTC
Tested using:
python-cinderclient-1.2.1-1.el7ost.noarch
python-cinder-2015.1.3-5.el7ost.noarch
openstack-cinder-2015.1.3-5.el7ost.noarch

Verification flow:

1. Set use_syslog=False in /etc/cinder/cinder.conf on the controller nodes
[root@overcloud-controller-0 ~]# grep -i use_syslog /etc/cinder/cinder.conf 
use_syslog=False

2. Restart cinder services 
[root@overcloud-controller-0 ~]# for i in `systemctl | awk '{print$1}' | grep cinder`; do systemctl restart $i; done

3. Search for cinder logs in /var/log/messages 
[root@overcloud-controller-0 ~]# grep -i cinder /var/log/messages | tail
[root@overcloud-controller-0 ~]#

Comment 9 errata-xmlrpc 2016-04-26 15:30:10 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2016-0688.html