<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Jun 27, 2014 at 7:32 PM, sylecn <span dir="ltr"><<a href="mailto:sylecn@gmail.com" target="_blank">sylecn@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class=""><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jun 27, 2014 at 5:03 PM, yangmin zhu <span dir="ltr"><<a href="mailto:zym0017d@gmail.com" target="_blank">zym0017d@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi all,<br>
I want to record a user's operation for later audit purpose. For<br>
example, A user may start/reboot/shutdown a VM using nova command from<br>
terminal or using the dashboard from browser.<br>
<br>
How can I record this action and it's result to a log file(or some<br>
other database) for later check? And I also want to do this for user's<br>
operations in cinder and nova-network, such as creating a volume or<br>
assigning a floating ip to a VM.<br>
<br>
Is there any existing solution for this purpose? If not, where and how<br>
should I start to do it myself by modifying the current nova's(or<br>
cinder, nova-network) code?<br>
</blockquote></div><br></div></div>I think this can be done via a WSGI middleware. You can add WSGI middleware in<br>paste deploy config file (api-paste.erb). I see there is already a logrequest<br>filter, you can check what it does and implement something similar.<br>
<br>Another solution will be wrap openstack API with your API and only expose your<br>API to user. This way you can do any logging you want. You can also log the<br>result of the request.<br><div class="gmail_extra"><div dir="ltr">
<div><br>--<br>Thanks,<br></div>Yuanle<br></div>
</div></div>
</blockquote></div><br></div><div class="gmail_extra"><br></div><div class="gmail_extra">I should also mention the notification system. I don't know which kind of<br>events are published to rabbitmq, but it may have enough information for<br>
logging purpose.<br><br><a href="https://wiki.openstack.org/wiki/NotificationSystem">https://wiki.openstack.org/wiki/NotificationSystem</a><br><br><br><div dir="ltr"><div>--<br>Thanks,<br></div>Yuanle<br></div>
</div></div>