Revision fdfd8c6d

b/snf-common/synnefo/lib/amqp_puka.py
52 52
from ordereddict import OrderedDict
53 53
from synnefo import settings
54 54

  
55
logger = logging.getLogger()
55
logger = logging.getLogger("amqp")
56 56

  
57 57

  
58 58
def reconnect_decorator(func):
b/snf-cyclades-app/synnefo/logic/callbacks.py
39 39

  
40 40
from synnefo.lib.utils import merge_time
41 41

  
42
log = logging.getLogger()
42
log = logging.getLogger(__name__)
43 43

  
44 44
def handle_message_delivery(func):
45 45
    """ Generic decorator for handling messages.
b/snf-cyclades-app/synnefo/logic/dispatcher.py
65 65
from synnefo.logic import queues
66 66

  
67 67
import logging
68
log = logging.getLogger()
68

  
69
log = logging.getLogger("dispatcher")
70
log_amqp = logging.getLogger("amqp")
71
log_logic = logging.getLogger("synnefo.logic")
72

  
73
LOGGERS = [log, log_amqp, log_logic]
69 74

  
70 75

  
71 76
class Dispatcher:
......
273 278
    import logging
274 279
    formatter = logging.Formatter("%(asctime)s %(name)s %(module)s [%(levelname)s] %(message)s")
275 280
    if opts.debug:
276
        stream_handler = logging.StreamHandler()
277
        stream_handler.setFormatter(formatter)
278
        log.addHandler(stream_handler)
281
        log_handler = logging.StreamHandler()
282
        log_handler.setFormatter(formatter)
279 283
    else:
280 284
        import logging.handlers
281 285
        log_file = "/var/log/synnefo/dispatcher.log"
282
        file_handler = logging.handlers.WatchedFileHandler(log_file)
283
        file_handler.setFormatter(formatter)
284
        log.addHandler(file_handler)
286
        log_handler = logging.handlers.WatchedFileHandler(log_file)
287
        log_handler.setFormatter(formatter)
285 288

  
286
    log.setLevel(logging.DEBUG)
289
    for l in LOGGERS:
290
        l.addHandler(log_handler)
291
        l.setLevel(logging.DEBUG)
287 292

  
288 293

  
289 294
def main():

Also available in: Unified diff