Hi guys,

Our disk of Nova controller has been filled with log files several times and it 
causes the node down.
Although log rotation of Operation system is working fine to make rotation 
every hour, it is not efficient.
Has anyone got any idea to rotate log files by size (e.g. 100MB) ?

It costs time to add a new log achieve server, therefore a temporary solution 
should be considered.

Best regards
From: Peng, Zhang

FYI: My own solution(not a good one) is shared here:
Referring to the document : 
I have found a way using python logging modules.

I added a configuration file as follows under /etc/nova/ directory:

File name: logging.conf
logfile =/var/log/nova/api.log

keys = root

keys = rotatingfile

keys = context

level = DEBUG
handlers = rotatingfile

class = handlers.RotatingFileHandler
args = (%(logfile)s, 'a', 5024000, 5)
formatter = context

class = nova.openstack.common.log.ContextFormatter

And I also changed this parameter in nova.conf to make nova use the above 

Everything seems going well except that all nova services such as api, 
scheduler, etc. begin
to put their log messages into the same file(api,log)!

So I have to put a script to replace the file name defined in DEFAULT session:
logfile = '%s.log' % (os.path.join('/var/log', 

It works but it’s also weird.
OpenStack-operators mailing list

Reply via email to