undefined方法`logger ='用于Neo4j :: ActiveNode:Module(NoMethodError)

时间:2014-07-04 13:28:49

标签: ruby-on-rails-4 neo4j log4r neo4j.rb

我正在尝试将log4r与rails 4和neo4j一起使用。我有log4r与Active记录,它工作正常但我无法使用neo4j。 我认为的主要问题是neo4j无法使用的记录器方法。我正在使用gem" neo4j"," 3.0.0.alpha.7" gem和" log4r"," 1.1.10"。

错误:

config/application.rb:59:in `<class:Application>': undefined method `logger=' for     Neo4j::ActiveNode:Module (NoMethodError)

以下是代码:

application.rb中

require File.expand_path('../boot', __FILE__)

# Pick the frameworks you want:
  require "active_model/railtie"
  require "action_controller/railtie"
  require "action_mailer/railtie"
  require "action_view/railtie"
  require "sprockets/railtie"
  require 'neo4j/railtie'
  require "rails/test_unit/railtie"
  require 'rails/all'
  require 'log4r'
  require 'yaml'
  require 'log4r/yamlconfigurator'
  require 'log4r/outputter/datefileoutputter'
  include Log4r


  # Require the gems listed in Gemfile, including any gems
  # you've limited to :test, :development, or :production.
  Bundler.require(*Rails.groups)

  module NewClarity
  class Application < Rails::Application

  config.generators do |g|
    g.orm             :neo4j
  end

  config.neo4j.session_type = :server_db 
  config.neo4j.session_path = 'http://localhost:7474'


  log4r_config= YAML.load_file(File.join(File.dirname(__FILE__),"log4r.yml"))
  log_cfg = YamlConfigurator
  log_cfg.decode_yaml( log4r_config['log4r_config'] )

  log = Log4r::Logger['rails']
 #config.logger = Log4r::Logger['rails']
  Neo4j::ActiveNode.logger = Log4r::Logger['rails'] 
  config.log_level = :unknown
 end
end

1 个答案:

答案 0 :(得分:0)

3.0.x版本目前没有日志记录支持,但我在其上添加了一个github问题https://github.com/andreasronge/neo4j/issues/374