Skip to content

Commit

Permalink
Change minimum (default) log level in PostgreSQL to warning.
Browse files Browse the repository at this point in the history
  • Loading branch information
kennyj authored and carlosantoniodasilva committed Jun 18, 2012
1 parent 8c02918 commit 052e415
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 5 deletions.
6 changes: 6 additions & 0 deletions activerecord/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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".
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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".
Expand Down

1 comment on commit 052e415

@sj26
Copy link
Contributor

@sj26 sj26 commented on 052e415 Jul 3, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Please sign in to comment.