Permalink
Browse files

Added some clarity on logging

  • Loading branch information...
1 parent 58eb0ab commit 22ab37e97d3d1d3d029facbb909418d9b9b32d5d @kennethkalmer committed Sep 16, 2009
View
@@ -48,6 +48,10 @@ using the silence helper:
# logger will only report :error or higher levels
end
+You can also set the logging per environment by editing the correct file in <em>config/environments</em>
+
+ config.log_level = :debug
+
=== Changing log levels via UNIX signals
Send your process the +USR1+ signal to toggle between <em>:debug</em>
@@ -1,2 +1,5 @@
# This is the same context as the environment.rb file, it is only
# loaded afterwards and only in the production environment
+
+# Change the production log level to debug
+#config.log_level = :debug
@@ -252,7 +252,7 @@ class Configuration
attr_accessor :logger
# The log level to use, defaults to DEBUG
- attr_accessor :log_level
+ attr_reader :log_level
# Path to the log file, defaults to 'log/<environment>.log'
configurable :log_path
@@ -286,7 +286,7 @@ class Configuration
# Our safety net (#Safety) instance
attr_accessor :safety_net
-
+
# :nodoc: Shutdown hooks
attr_reader :shutdown_hooks
@@ -344,6 +344,12 @@ def pid_file
@pid_file ||= "#{File.dirname(self.log_path)}/#{self.daemon_name}.pid"
end
+ # Set the log level
+ def log_level=( level )
+ @log_level = level
+ DaemonKit.logger.level = @log_level if DaemonKit.logger
+ end
+
protected
def run_traps( signal )

0 comments on commit 22ab37e

Please sign in to comment.