Project

General

Profile

« Previous | Next » 

Revision e0497ca9

Added by Dmitri Dolguikh over 8 years ago

fixes #11653: only display warning message about unavailability of 'SYSLOG' when it was configured

View differences:

lib/proxy/log.rb
begin
require 'syslog/logger'
::Syslog::Logger.class_eval { alias_method :write, :info }
rescue LoadError
puts "Setting log_file=SYSLOG not supported on this platform, ignoring"
rescue LoadError # rubocop:disable Lint/HandleExceptions
# ignore, syslog isn't available on this platform
end
# rubocop:enable Lint/HandleExceptions
# ::Rack::CommonLogger expects loggers to implement 'write' method
Logger.class_eval { alias_method :write, :info }
......
logger = ::Syslog::Logger.new 'foreman-proxy'
rescue
logger = default_logger(log_file)
puts "'SYSLOG' logger is not supported on this platform, using file-based logger instead"
end
else
logger = default_logger(log_file)

Also available in: Unified diff