diff --git a/Gemfile.lock b/Gemfile.lock index 90d8b3d648c..2713400e7f3 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -152,7 +152,7 @@ GEM thor (~> 0.15) libv8 (3.16.14.3) listen (0.7.3) - logster (0.0.4) + logster (0.0.5) lru_redux (0.8.1) mail (2.5.4) mime-types (~> 1.16) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 7fa94a656f1..76b4d2bdfa0 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -28,6 +28,7 @@ class ApplicationController < ActionController::Base end end + before_filter :set_current_user_for_logs before_filter :set_locale before_filter :set_mobile_view before_filter :inject_preview_style @@ -120,6 +121,12 @@ class ApplicationController < ActionController::Base end end + def set_current_user_for_logs + if current_user + Logster.add_to_env(request.env,"username",current_user.username) + end + end + def set_locale I18n.locale = if SiteSetting.allow_user_locale && current_user && current_user.locale.present? current_user.locale