{"record":{"id":"3561a1d0b7de8851","repo":"padrino/padrino-framework","slug":"no-logging-configuration-for-config-level-foun","errorCode":null,"errorMessage":"No logging configuration for :#{config_level} found, falling back to :production","messagePattern":"No logging configuration for :#(.+?) found, falling back to :production","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"padrino-core/lib/padrino-core/logger.rb","lineNumber":356,"sourceCode":"                    To do it with a custom logger you have to manually `new_logger.extend(Padrino::Logger::Extensions)`\n                    before passing to `Padrino.logger = new_logger`.\n        MESSAGE\n      end\n      @_logger = logger\n    end\n\n    ##\n    # Setup a new logger.\n    #\n    # @return [Padrino::Logger]\n    #   A {Padrino::Logger} instance\n    #\n    def self.setup!\n      config_level = (PADRINO_LOG_LEVEL || Padrino.env || :test).to_sym # need this for PADRINO_LOG_LEVEL\n      config = Config[config_level]\n\n      unless config\n        warn(\"No logging configuration for :#{config_level} found, falling back to :production\")\n        config = Config[:production]\n      end\n\n      stream =\n        case config[:stream]\n        when :to_file\n          if (filename = config[:log_path])\n            filename = Padrino.root(filename) unless Pathname.new(filename).absolute?\n            if File.directory?(filename)\n              filename = File.join(filename, \"#{Padrino.env}.log\")\n            else\n              FileUtils.mkdir_p(File.dirname(filename))\n            end\n            File.new(filename, 'a+')\n          else\n            FileUtils.mkdir_p(Padrino.root('log')) unless File.exist?(Padrino.root('log'))\n            File.new(Padrino.root('log', \"#{Padrino.env}.log\"), 'a+')\n          end","sourceCodeStart":338,"sourceCodeEnd":374,"githubUrl":"https://github.com/padrino/padrino-framework/blob/167044f3d56b2bce12f943eb826fdb0b0ea94375/padrino-core/lib/padrino-core/logger.rb#L338-L374","documentation":"Logger.setup! picks the logger configuration from Padrino::Logger::Config using PADRINO_LOG_LEVEL or Padrino.env. Only :production, :development and :test exist by default, plus any keys merged from the PADRINO_LOGGER constant. When the resolved level has no Config entry, Padrino warns and silently falls back to the production configuration (log level :warn, stream :to_file).","triggerScenarios":"Running with PADRINO_ENV=staging or any custom environment (:qa, :demo) without a matching PADRINO_LOGGER entry; setting PADRINO_LOG_LEVEL to a word that is not a Config key such as verbose or info (it selects a config profile, not a severity).","commonSituations":"CI/CD pipelines deploying to staging-style environments; teams surprised that staging logs to a file at warn level because of the silent fallback; custom RACK_ENV/PADRINO_ENV naming schemes that drift from the three defaults.","solutions":["Define the environment's profile before the framework loads — in config/boot.rb: PADRINO_LOGGER = { staging: { log_level: :debug, stream: :stdout } } (these keys are merged into Config)","Or add the key directly before any logging happens: Padrino::Logger::Config[:staging] = { log_level: :info, stream: :to_file, log_path: 'log' }","Or force a known profile by setting PADRINO_LOG_LEVEL to production, development or test"],"exampleFix":"# before — PADRINO_ENV=staging warns and falls back to :production (warn level, file logging)\n\n# after — config/boot.rb, before apps load:\nPADRINO_LOGGER = { staging: { log_level: :debug, stream: :stdout } }","handlingStrategy":"validation","validationCode":"# in boot.rb, before Padrino loads\nlevel = (ENV['PADRINO_LOG_LEVEL'] || ENV['PADRINO_ENV'] || 'test').to_sym\nPADRINO_LOGGER = { level => { log_level: :debug, stream: :stdout } } unless %i[production development test].include?(level)","typeGuard":"def known_padrino_log_env?(name)\n  Padrino::Logger::Config.key?(name.to_sym)\nend","tryCatchPattern":null,"preventionTips":["Map every deploy environment name to a PADRINO_LOGGER entry in boot.rb","Whitelist PADRINO_ENV values in deployment scripts","Remember the fallback silently uses production settings: warn level, logs written to a file"],"tags":["padrino","logger","environment","configuration","fallback"],"backgroundTag":"unknown-environment-fallback","analyzedSha":"167044f3d56b2bce12f943eb826fdb0b0ea94375","analyzedAt":"2026-08-23T12:41:41.049Z","schemaVersion":2},"datasetVersion":"2026-08-23T16:17:53.355Z"}