Configure swift logging.

Split logs by storage node proxy and don't fill up the
/var/log/messages.

Set proxy-server in debug.

Only one worker by proxy-server since we are usually in debugging mode.

Change-Id: If39f35b98ad821e8a62e36e4c22e723f83e01db8
diff --git a/stack.sh b/stack.sh
index cdba542..bc7af65 100755
--- a/stack.sh
+++ b/stack.sh
@@ -757,9 +757,10 @@
 
     USER_GROUP=$(id -g)
     sudo mkdir -p ${SWIFT_DATA_LOCATION}/drives
-    sudo chown -R $USER:${USER_GROUP} ${SWIFT_DATA_LOCATION}/drives
+    sudo chown -R $USER:${USER_GROUP} ${SWIFT_DATA_LOCATION}
 
     # We then create a loopback disk and format it to XFS.
+    # TODO: Reset disks on new pass.
     if [[ ! -e ${SWIFT_DATA_LOCATION}/drives/images/swift.img ]]; then
         mkdir -p  ${SWIFT_DATA_LOCATION}/drives/images
         sudo touch  ${SWIFT_DATA_LOCATION}/drives/images/swift.img
@@ -853,6 +854,17 @@
    generate_swift_configuration container 6011 2
    generate_swift_configuration account 6012 2
 
+
+   # We have some specific configuration for swift for rsyslog. See
+   # the file /etc/rsyslog.d/10-swift.conf for more info.
+   swift_log_dir=${SWIFT_DATA_LOCATION}/logs
+   rm -rf ${swift_log_dir}
+   mkdir -p ${swift_log_dir}/hourly
+   sudo chown -R syslog:adm ${swift_log_dir}
+   sed "s,%SWIFT_LOGDIR%,${swift_log_dir}," $FILES/swift/rsyslog.conf | sudo \
+       tee /etc/rsyslog.d/10-swift.conf
+   sudo restart rsyslog
+   
    # We create two helper scripts :
    #
    # - swift-remakerings