0

I am trying to use log4r with rails 4 and neo4j. I have log4r with Active record and it works fine but I am unable to get it working with neo4j. Main problem which I think is the logger method which is not available for neo4j. I am using gem "neo4j", "3.0.0.alpha.7" gem and "log4r", "1.1.10".

Error:

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

Here is the code on :

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
Community
  • 1
  • 1
vishB
  • 1,688
  • 2
  • 17
  • 23

1 Answers1

0

There is no logging support currently in the 3.0.x version, but I added a github issue on it https://github.com/andreasronge/neo4j/issues/374

Andreas Ronge
  • 321
  • 1
  • 4