Browse code

Merge "Configure swift logging."

Jenkins authored on 2012/01/06 08:26:53
Showing 3 changed files
... ...
@@ -1,8 +1,11 @@
1 1
 [DEFAULT]
2 2
 bind_port = 8080
3 3
 user = %USER%
4
-log_facility = LOG_LOCAL1
5 4
 swift_dir = %SWIFT_CONFIG_LOCATION%
5
+workers = 1
6
+log_name = swift
7
+log_facility = LOG_LOCAL1
8
+log_level = DEBUG
6 9
 
7 10
 [pipeline:main]
8 11
 pipeline = healthcheck cache %AUTH_SERVER% proxy-server
9 12
new file mode 100644
... ...
@@ -0,0 +1,26 @@
0
+# Uncomment the following to have a log containing all logs together
1
+#local1,local2,local3,local4,local5.*   %SWIFT_LOGDIR%/all.log
2
+
3
+# Uncomment the following to have hourly proxy logs for stats processing
4
+#$template HourlyProxyLog,"%SWIFT_LOGDIR%/hourly/%$YEAR%%$MONTH%%$DAY%%$HOUR%"
5
+#local1.*;local1.!notice ?HourlyProxyLog
6
+
7
+local1.*;local1.!notice %SWIFT_LOGDIR%/proxy.log
8
+local1.notice           %SWIFT_LOGDIR%/proxy.error
9
+local1.*                ~
10
+
11
+local2.*;local2.!notice %SWIFT_LOGDIR%/storage1.log
12
+local2.notice           %SWIFT_LOGDIR%/storage1.error
13
+local2.*                ~
14
+
15
+local3.*;local3.!notice %SWIFT_LOGDIR%/storage2.log
16
+local3.notice           %SWIFT_LOGDIR%/storage2.error
17
+local3.*                ~
18
+
19
+local4.*;local4.!notice %SWIFT_LOGDIR%/storage3.log
20
+local4.notice           %SWIFT_LOGDIR%/storage3.error
21
+local4.*                ~
22
+
23
+local5.*;local5.!notice %SWIFT_LOGDIR%/storage4.log
24
+local5.notice           %SWIFT_LOGDIR%/storage4.error
25
+local5.*                ~
... ...
@@ -868,9 +868,10 @@ if [[ "$ENABLED_SERVICES" =~ "swift" ]]; then
868 868
 
869 869
     USER_GROUP=$(id -g)
870 870
     sudo mkdir -p ${SWIFT_DATA_LOCATION}/drives
871
-    sudo chown -R $USER:${USER_GROUP} ${SWIFT_DATA_LOCATION}/drives
871
+    sudo chown -R $USER:${USER_GROUP} ${SWIFT_DATA_LOCATION}
872 872
 
873 873
     # We then create a loopback disk and format it to XFS.
874
+    # TODO: Reset disks on new pass.
874 875
     if [[ ! -e ${SWIFT_DATA_LOCATION}/drives/images/swift.img ]]; then
875 876
         mkdir -p  ${SWIFT_DATA_LOCATION}/drives/images
876 877
         sudo touch  ${SWIFT_DATA_LOCATION}/drives/images/swift.img
... ...
@@ -964,6 +965,17 @@ if [[ "$ENABLED_SERVICES" =~ "swift" ]]; then
964 964
    generate_swift_configuration container 6011 2
965 965
    generate_swift_configuration account 6012 2
966 966
 
967
+
968
+   # We have some specific configuration for swift for rsyslog. See
969
+   # the file /etc/rsyslog.d/10-swift.conf for more info.
970
+   swift_log_dir=${SWIFT_DATA_LOCATION}/logs
971
+   rm -rf ${swift_log_dir}
972
+   mkdir -p ${swift_log_dir}/hourly
973
+   sudo chown -R syslog:adm ${swift_log_dir}
974
+   sed "s,%SWIFT_LOGDIR%,${swift_log_dir}," $FILES/swift/rsyslog.conf | sudo \
975
+       tee /etc/rsyslog.d/10-swift.conf
976
+   sudo restart rsyslog
977
+   
967 978
    # We create two helper scripts :
968 979
    #
969 980
    # - swift-remakerings