diff --git a/Changelog.md b/Changelog.md
index 4b845faf45cf30da2e9ff916fdd7362cde7e6392..12f90669dbd6a17b2703dfe42345c0a56f5b868b 100644
--- a/Changelog.md
+++ b/Changelog.md
@@ -56,6 +56,7 @@
 * Add popover/tooltip about email visibility to registration/settings page [#5956](https://github.com/diaspora/diaspora/pull/5956)
 * Fetch person posts on sharing request [#5960](https://github.com/diaspora/diaspora/pull/5960)
 * Introduce 'authorized' configuration option for services [#5985](https://github.com/diaspora/diaspora/pull/5985)
+* Added configuration options for log rotating [#5994](https://github.com/diaspora/diaspora/pull/5994)
 
 # 0.5.0.1
 
diff --git a/config/defaults.yml b/config/defaults.yml
index f37804600c84b66e04c0c4b05c6e175fc99367bc..70ed9dd991a76e67e2f7ba987aee48e4cc799e6f 100644
--- a/config/defaults.yml
+++ b/config/defaults.yml
@@ -31,6 +31,10 @@ defaults:
       upload: false
       host:
     pubsub_server: 'https://pubsubhubbub.appspot.com/'
+    logging:
+      logrotate:
+        enable: true
+        days: 7
   server:
     port:
     listen: '0.0.0.0:3000'
diff --git a/config/diaspora.yml.example b/config/diaspora.yml.example
index 91fe4191b95a3c49b067c247023d4199035d79c9..5214dd0de694c0969b4bab2a79a82b5d8e78624a 100644
--- a/config/diaspora.yml.example
+++ b/config/diaspora.yml.example
@@ -138,6 +138,17 @@ configuration: ## Section
     ## You probably don't want to uncomment or change this.
     #pubsub_server: 'https://pubsubhubbub.appspot.com/'
 
+    ## Logger configuration
+    logging: ## Section
+
+      logrotate: ## Section
+
+        ## Roll the application log on a daily basis (default=true).
+        #enable: true
+
+        ## The number of days to keep (default=7)
+        #days: 7
+
   ## Settings affecting how ./script/server behaves.
   server: ## Section
     ## Where the appserver should listen to (default=0.0.0.0:3000)
diff --git a/config/logging.rb b/config/logging.rb
index ae5d536fd2eb2ac5c539841bff0d7f7aeafdfcac..77214f7a4c58344504d2ec068a781fe85796d09d 100644
--- a/config/logging.rb
+++ b/config/logging.rb
@@ -36,18 +36,30 @@ Logging::Rails.configure do |config|
                            )
                           ) if config.log_to.include? "stdout"
 
-  # Configure an appender that will write log events to a file. The file will
-  # be rolled on a daily basis, and the past 7 rolled files will be kept.
-  # Older files will be deleted. The default pattern layout is used when
-  # formatting log events into strings.
-  Logging.appenders.rolling_file("file",
-                                 filename:      config.paths["log"].first,
-                                 keep:          7,
-                                 age:           "daily",
-                                 truncate:      false,
-                                 auto_flushing: true,
-                                 layout:        layout
-                                ) if config.log_to.include? "file"
+  if config.log_to.include? "file"
+    # Configure an appender that will write log events to a file.
+    if AppConfig.environment.logging.logrotate.enable?
+      # The file will be rolled on a daily basis, and the rolled files will be kept
+      # the configured number of days. Older files will be deleted. The default pattern
+      # layout is used when formatting log events into strings.
+      Logging.appenders.rolling_file("file",
+                                     filename:      config.paths["log"].first,
+                                     keep:          AppConfig.environment.logging.logrotate.days.to_i,
+                                     age:           "daily",
+                                     truncate:      false,
+                                     auto_flushing: true,
+                                     layout:        layout
+                                    )
+    else
+      # No file rolling, use logrotate to roll the logfile.
+      Logging.appenders.file("file",
+                             filename:      config.paths["log"].first,
+                             truncate:      false,
+                             auto_flushing: true,
+                             layout:        layout
+                            )
+    end
+  end
 
   # Setup the root logger with the Rails log level and the desired set of
   # appenders. The list of appenders to use should be set in the environment