Skip to content

Commit

Permalink
Merge pull request #7 from wcombs/master
Browse files Browse the repository at this point in the history
added nested hashdir logging for jobs
  • Loading branch information
wcombs committed Oct 28, 2015
2 parents da4eeec + 91bbcae commit 6d14956
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/Resque/Job.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,11 @@ public static function create($queue, $class, $args = null, $monitor = false)
);
}
$id = md5(uniqid('', true));
$prefix = preg_replace('/:$/', '', Resque::redis()->getPrefix());
$args['logfile'] = '/logs/resque/' . $prefix . '_jobout/' . $id . '.log';

if (defined('JOB_OUT_NESTING_BASEDIR')) {
$args['logfile'] = JOB_OUT_NESTING_BASEDIR . substr($id, 0, 1) . '/' . substr($id, 1, 1) . '/' . $id . '.log';
}

Resque::push($queue, array(
'class' => $class,
'args' => array($args),
Expand Down

0 comments on commit 6d14956

Please sign in to comment.