Skip to content

Commit

Permalink
Remove active_record_serializer logs in prod
Browse files Browse the repository at this point in the history
  • Loading branch information
farhatahmad committed Nov 15, 2023
1 parent 65766d4 commit cecf9ea
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 13 deletions.
6 changes: 0 additions & 6 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -538,9 +538,3 @@ DEPENDENCIES
web-console (>= 4.2.1)
webdrivers
webmock

RUBY VERSION
ruby 3.0.0p0

BUNDLED WITH
2.2.3
10 changes: 3 additions & 7 deletions config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -135,17 +135,13 @@
# require "syslog/logger"
# config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new "app-name")

if ENV['RAILS_LOG_TO_STDOUT'].present?
$stdout.sync = true
logger = ActiveSupport::Logger.new($stdout)
logger.formatter = config.log_formatter
config.logger = ActiveSupport::TaggedLogging.new(logger)
end

if ENV['RAILS_LOG_REMOTE_NAME'] && ENV['RAILS_LOG_REMOTE_PORT']
require 'remote_syslog_logger'
logger_program = ENV['RAILS_LOG_REMOTE_TAG'] || "greenlight-v3-#{ENV.fetch('RAILS_ENV', nil)}"
logger = RemoteSyslogLogger.new(ENV['RAILS_LOG_REMOTE_NAME'], ENV['RAILS_LOG_REMOTE_PORT'], program: logger_program)
else
$stdout.sync = true
logger = ActiveSupport::Logger.new($stdout)
end

logger.formatter = config.log_formatter
Expand Down
19 changes: 19 additions & 0 deletions config/initializers/active_model_serializers.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# BigBlueButton open source conferencing system - http://www.bigbluebutton.org/.
#
# Copyright (c) 2022 BigBlueButton Inc. and by respective authors (see below).
#
# This program is free software; you can redistribute it and/or modify it under the
# terms of the GNU Lesser General Public License as published by the Free Software
# Foundation; either version 3.0 of the License, or (at your option) any later
# version.
#
# Greenlight is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License along
# with Greenlight; if not, see <http://www.gnu.org/licenses/>.

# frozen_string_literal: true

ActiveModelSerializers.logger = Logger.new(IO::NULL) if Rails.env.production?

0 comments on commit cecf9ea

Please sign in to comment.