crowbar / crowbar

Cloud Operations Platform
https://github.com/crowbar/crowbar
Apache License 2.0
758 stars 266 forks source link

minor issues with crowbar_framework logging #834

Open aspiers opened 12 years ago

aspiers commented 12 years ago

/opt/dell/crowbar_framework/config/environments/production.rb

contains:

require 'syslogger'
config.logger = Syslogger.new("crowbar_app", Syslog::LOG_PID, Syslog::LOG_LOCAL0)
config.logger.level = Logger::DEBUG

I have no complaint with the use of syslog, but it does cause a mess when Rails outputs stack traces which appear as a single syslog line, e.g.

May 18 10:25:41 crowbar-admin-sles crowbar_app[1602]: RuntimeError (Can't find any crowbar proposal): app/models/crowbar_service.rb:226:in `read_options'   app/controllers/nodes_controller.rb:117:in `list'   haml (2.2.20) rails/./lib/sass/plugin/rails.rb:20:in `process'   rainbows (4.3.1) lib/rainbows/event_machine/client.rb:41:in `app_call'   rainbows (4.3.1) lib/rainbows/event_machine/client.rb:40:in `catch'   rainbows (4.3.1) lib/rainbows/event_machine/client.rb:40:in `app_call'   rainbows (4.3.1) lib/rainbows/ev_core.rb:97:in `on_read'   rainbows (4.3.1) lib/rainbows/event_machine/client.rb:25:in `receive_data'   eventmachine (0.12.10) lib/eventmachine.rb:256:in `run_machine'   eventmachine (0.12.10) lib/eventmachine.rb:256:in `run'   rainbows (4.3.1) lib/rainbows/event_machine.rb:86:in `worker_loop'   rainbows (4.3.1) lib/rainbows/http_server.rb:44:in `worker_loop'   unicorn (4.1.0) lib/unicorn/http_server.rb:485:in `spawn_missing_workers'   rainbows (4.3.1) lib/rainbows/http_server.rb:60:in `spawn_missing_workers' unicorn (4.1.0) lib/unicorn/http_server.rb:135:in `start'   rainbows (4.3.1) bin/rainbows:122 /usr/bin/rainbows:19:in `load'   /usr/bin/rainbows:19

Clearly that's a bit awkward to read :-) It looks like this might be a limitation of the syslogger gem. Crowbar is on the latest version of the gem (1.3.0) and I don't see any issue currently filed regarding this. The nearest I could find was a rejected pull request to actually join multiple lines into a single line!

Additionally, there are various puts lines (e.g. look at ApplicationController::find_user() in crowbar_framework/app/controllers/application_controller.rb) which never appear in either syslog or /opt/dell/crowbar_framework/log - I'm not sure where they vanish to.

aabes commented 12 years ago

Thank you for your note. We're not actively using the github issue tracker feature. Since most crowbar users would like to participate in the conversation, please post your notes and issues to the crowbar mailing list: https://lists.us.dell.com/mailman/listinfo/crowbar .

aspiers commented 12 years ago

Please see https://github.com/dellcloudedge/crowbar/issues/928#issuecomment-6910619