Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

resque-logger

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

resque-logger

  • 0.2.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Resque Per-worker Logger Plugin

Tired of create mechanisms to isolate log files to each Resque worker in your application? The gem resque-logger gives you a simple plugin to create a log file based on queue name.

Configuration

Using a initializer

# config/initializers/resque.rb

log_path = File.join Rails.root, 'log'

config = {
  folder:     log_path,                 # destination folder
  class_name: Logger,                   # logger class name
  class_args: [ 'daily', 1.kilobyte ],  # logger additional parameters
  level:      Logger::INFO,             # optional
  formatter:  Logger::Formatter.new,    # optional
}

Resque.logger_config = config

Usage

Adding to a resque worker

# app/workers/my_killer_worker.rb

class MyKillerWorker
  extend Resque::Plugins::Logger

  @queue = :my_killer_worker_job
  @log_name = "my_killer_log_name.log" # Optional - defaults to using the queue name.

  def self.perform(args = {})
    (...)

    logger.info('it works!')

    (...)
  end
end

Dependencies

  • resque

Installation

With rubygems:

$ [sudo] gem install resque-logger

Authors

License

ResqueLogger is free and unencumbered public domain software. For more information, see http://unlicense.org/ or the accompanying UNLICENSE file.

FAQs

Package last updated on 25 Jun 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc