Skip to content

Add convenience method for delayed Rails startup logging #4

Open
@dmolesUC

Description

@dmolesUC

Logging early in the Rails startup sequence (e.g. in application.rb or in one of the files under config/environments) can fail due to the logger not being initialized. In this situation the workaround is to wrap the call to the logger in a config.after_initialize block:

config.after_initialize do
  Rails.logger.info('msg', obj)
end

It would be nice to have a convenience object or set of convenience methods that would DRY this and keep the complexity out of the config/initialization files.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions