Project

General

Profile

Actions

Bug #14820

closed

Log level from settings.yaml not applied to app logger

Added by Dominic Cleal almost 8 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Logging
Target version:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

In Foreman 1.11 and higher, the log level configured in config/settings.yaml isn't applied to the app logger, so production users only get info+ messages.

On 1.10-stable:

2016-04-26T15:28:08 [app] [I] Started GET "/users/login" for 127.0.0.1 at 2016-04-26 15:28:08 +0100
2016-04-26T15:28:08 [app] [I] Processing by UsersController#login as HTML
2016-04-26T15:28:08 [app] [D] Setting current user thread-local variable to nil
2016-04-26T15:28:08 [app] [I]   Rendered users/login.html.erb within layouts/login (9.4ms)
2016-04-26T15:28:08 [app] [I]   Rendered layouts/base.html.erb (15.2ms)

On 1.11-stable:

2016-04-26T15:30:39 [app] [I] Started GET "/users/login" for 127.0.0.1 at 2016-04-26 15:30:39 +0100
2016-04-26T15:30:39 [app] [I] Processing by UsersController#login as HTML
2016-04-26T15:30:39 [sql] [D]   ActiveRecord::SessionStore::Session Load (0.1ms)  SELECT  "sessions".* FROM "sessions"  WHERE "sessions"."session_id" = 'ae80f506141e1f10e0c7bbcee6b62566'  ORDER BY "sessions"."id" ASC LIMIT 1
2016-04-26T15:30:39 [sql] [D]   Setting Load (0.1ms)  SELECT  "settings".* FROM "settings"  WHERE "settings"."name" = 'authorize_login_delegation'  ORDER BY "settings"."name" ASC LIMIT 1
2016-04-26T15:30:39 [app] [I]   Rendered users/login.html.erb within layouts/login (2.0ms)
2016-04-26T15:30:39 [app] [I]   Rendered layouts/base.html.erb (2.8ms)
2016-04-26T15:30:39 [sql] [D]   Setting Load (0.2ms)  SELECT  "settings".* FROM "settings"  WHERE "settings"."name" = 'idle_timeout'  ORDER BY "settings"."name" ASC LIMIT 1
2016-04-26T15:30:39 [app] [I] Completed 200 OK in 25ms (Views: 7.8ms | ActiveRecord: 2.4ms)

However, change config.log_level in config/environments/production.rb to :debug and it does correctly print app logger debug:

2016-04-26T15:31:50 [app] [I] Started GET "/users/login" for 127.0.0.1 at 2016-04-26 15:31:50 +0100
2016-04-26T15:31:50 [app] [I] Processing by UsersController#login as HTML
2016-04-26T15:31:50 [sql] [D]   ActiveRecord::SessionStore::Session Load (0.1ms)  SELECT  "sessions".* FROM "sessions"  WHERE "sessions"."session_id" = 'ae80f506141e1f10e0c7bbcee6b62566'  ORDER BY "sessions"."id" ASC LIMIT 1
2016-04-26T15:31:50 [sql] [D]   Setting Load (0.1ms)  SELECT  "settings".* FROM "settings"  WHERE "settings"."name" = 'authorize_login_delegation'  ORDER BY "settings"."name" ASC LIMIT 1
2016-04-26T15:31:50 [app] [D] Setting current user thread-local variable to nil
2016-04-26T15:31:50 [app] [I]   Rendered users/login.html.erb within layouts/login (2.1ms)
2016-04-26T15:31:50 [app] [I]   Rendered layouts/base.html.erb (1.3ms)
2016-04-26T15:31:50 [sql] [D]   Setting Load (0.2ms)  SELECT  "settings".* FROM "settings"  WHERE "settings"."name" = 'idle_timeout'  ORDER BY "settings"."name" ASC LIMIT 1
2016-04-26T15:31:50 [app] [I] Completed 200 OK in 23ms (Views: 7.0ms | ActiveRecord: 2.2ms)

It shouldn't be necessary to do this, the Foreman logging support is meant to reconfigure the app logger.


Related issues 1 (0 open1 closed)

Related to Foreman - Refactor #12914: update rails configuration files to match to 4.1 syntaxClosedOhad Levy12/22/2015Actions
Actions #1

Updated by Dominic Cleal almost 8 years ago

  • translation missing: en.field_release set to 155
Actions #2

Updated by Dominic Cleal almost 8 years ago

  • Status changed from New to Assigned
  • Assignee set to Dominic Cleal
Actions #3

Updated by Dominic Cleal almost 8 years ago

  • Related to Refactor #12914: update rails configuration files to match to 4.1 syntax added
Actions #4

Updated by The Foreman Bot almost 8 years ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/3475 added
Actions #5

Updated by Dominic Cleal almost 8 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100
Actions

Also available in: Atom PDF