Permalink
Browse files

Change minimum (default) log level in PostgreSQL to warning.

  • Loading branch information...
1 parent 8c02918 commit 052e415f22b98bb45a5245ac8f7aa23c6f32e478 @kennyj kennyj committed with carlosantoniodasilva Jun 16, 2012
@@ -1,5 +1,11 @@
## Rails 4.0.0 (unreleased) ##
+* PostgreSQL default log level is now 'warning', to bypass the noisy notice
+ messages. You can change the log level using the `min_messages` option
+ available in your config/database.yml.
+
+ *kennyj*
+
* Add uuid datatype support to PostgreSQL adapter. *Konstantin Shabanov*
* `update_attribute` has been removed. Use `update_column` if
@@ -1450,7 +1450,7 @@ def configure_connection
if @config[:encoding]
@connection.set_client_encoding(@config[:encoding])
end
- self.client_min_messages = @config[:min_messages] if @config[:min_messages]
+ self.client_min_messages = @config[:min_messages] || 'warning'
self.schema_search_path = @config[:schema_search_path] || @config[:schema_order]
# Use standard-conforming strings if available so we don't have to do the E'...' dance.
@@ -21,6 +21,10 @@ def test_encoding
assert_not_nil @connection.encoding
end
+ def test_default_client_min_messages
+ assert_equal "warning", @connection.client_min_messages
+ end
+
# Ensure, we can set connection params using the example of Generic
# Query Optimizer (geqo). It is 'on' per default.
def test_connection_options
@@ -22,8 +22,8 @@ development:
# Minimum log levels, in increasing order:
# debug5, debug4, debug3, debug2, debug1,
# log, notice, warning, error, fatal, and panic
- # The server defaults to notice.
- #min_messages: warning
+ # Defaults to warning.
+ #min_messages: notice
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
@@ -35,8 +35,8 @@ development:
# Minimum log levels, in increasing order:
# debug5, debug4, debug3, debug2, debug1,
# log, notice, warning, error, fatal, and panic
- # The server defaults to notice.
- #min_messages: warning
+ # Defaults to warning.
+ #min_messages: notice
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".

1 comment on commit 052e415

@sj26
Contributor
sj26 commented on 052e415 Jul 3, 2012

This is something I end up doing in every single project. 👍

Please sign in to comment.