Skip to content

Commit

Permalink
Added README and license.
Browse files Browse the repository at this point in the history
  • Loading branch information
salizzar committed May 2, 2012
1 parent 127b65e commit aed86e9
Show file tree
Hide file tree
Showing 2 changed files with 89 additions and 0 deletions.
64 changes: 64 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
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

Usage
=====

### Adding to a resque worker
# app/workers/my_killer_worker.rb

class MyKillerWorker
extend Resque::Plugins::Logger

@queue = :my_killer_worker_job

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

Dependencies
============

* resque

Installation
============

### With rubygems:
$ [sudo] gem install resque-logger

Authors
=======

* Marcelo Correia Pinheiro - <http://salizzar.net/>

License
=======

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

[Resque]: https://github.com/defunkt/resque

25 changes: 25 additions & 0 deletions UNLICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
This is free and unencumbered software released into the public domain.

Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.

In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

For more information, please refer to <http://unlicense.org/>

0 comments on commit aed86e9

Please sign in to comment.