Skip to content

Cant convince logstasher to write to file instead of console #146

@shayneoAtNorwood

Description

@shayneoAtNorwood

I'm not sure what I'm doing wrong here, but I cant seem to convince logstasher to write its entries to a file instead of the console.

I have this in development.rb

# Enable the logstasher logs for the current environment
  config.logstasher.enabled = true
  # Each of the following lines are optional. If you want to selectively disable log subscribers.
  config.logstasher.controller_enabled = true
  config.logstasher.mailer_enabled = false
  config.logstasher.record_enabled = true
  config.logstasher.view_enabled = true
  config.logstasher.job_enabled = true
  # This line is optional if you do not want to suppress app logs in your <environment>.log
  config.logstasher.suppress_app_log = false
  # This line is optional, it allows you to set a custom value for the @source field of the log event
  config.logstasher.source = 'dev.local'
  # This line is optional if you do not want to log the backtrace of exceptions
  config.logstasher.backtrace = true
  # This line is optional, defaults to log/logstasher_<environment>.log
  config.logstasher.logger_path = 'log/logstasher.log'

I've also tried this

  # addthis info your development.rb or other environment file
  config.to_prepare do
    LogStasher.logger = Logger.new("#{Rails.root}/log/logstasher.log")
  end

To no effect....

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions