         @feed = db.changes since:'now'
         @feed.on 'change', @_onChange
         @feed.on 'error', (err) =>
-            compound.logger.write "error occured with feed : #{err.stack}"
+            @app.compound.logger.write "error occured with feed : #{err.stack}"
             @stopListening()
 
         @db = db

    feed:undefined
    redisClient:undefined

    constructor: (app) ->
        @startPublishingToRedis()

        app.compound.server.on 'close', =>
            @stopListening()
            @redisClient.end() if @redisClient?


    startPublishingToRedis: () ->
        redis = require('redis')
        @redisClient = redis.createClient REDIS_PORT, REDIS_HOST,
            max_attempts: 1
        @redisClient.on "error", (err) =>
            @app.compound.logger.write "Failled to connect to redis : #{err.stack}"
            @app.compound.logger.write "Everything else should work as expected"
        @redisClient.on "connect", =>
            @app.compound.logger.write "Begins publishing changes to redis"

    publish: (event, id) => @_publish(event, id)

