This document describes the current stable version of Celery (3.1). For development docs, go here.

celery.utils.log

celery.utils.log

Logging utilities.

class celery.utils.log.ColorFormatter(fmt=None, use_color=True)[source]
COLORS = {u'blue': <bound method colored.blue of u''>, u'black': <bound method colored.black of u''>, u'yellow': <bound method colored.yellow of u''>, u'cyan': <bound method colored.cyan of u''>, u'green': <bound method colored.green of u''>, u'magenta': <bound method colored.magenta of u''>, u'white': <bound method colored.white of u''>, u'red': <bound method colored.red of u''>}
colors = {'DEBUG': <bound method colored.blue of u''>, 'CRITICAL': <bound method colored.magenta of u''>, 'WARNING': <bound method colored.yellow of u''>, 'ERROR': <bound method colored.red of u''>}
format(record)[source]
formatException(ei)[source]
class celery.utils.log.LoggingProxy(logger, loglevel=None)[source]

Forward file object to logging.Logger instance.

Parameters:
  • logger – The logging.Logger instance to forward to.
  • loglevel – Loglevel to use when writing messages.
close()[source]

When the object is closed, no write requests are forwarded to the logging object anymore.

closed = False
flush()[source]

This object is not buffered so any flush() requests are ignored.

isatty()[source]

Always return False. Just here for file support.

loglevel = 40
mode = 'w'
name = None
write(data)[source]

Write message to logging object.

writelines(sequence)[source]

writelines(sequence_of_strings) -> None.

Write the strings to the file.

The sequence can be any iterable object producing strings. This is equivalent to calling write() for each string.

celery.utils.log.set_in_sighandler(value)[source]
celery.utils.log.in_sighandler(*args, **kwds)[source]
celery.utils.log.get_logger(name)[source]
celery.utils.log.get_task_logger(name)[source]
celery.utils.log.mlevel(level)[source]
celery.utils.log.ensure_process_aware_logger(force=False)[source]

Make sure process name is recorded when loggers are used.

celery.utils.log.get_multiprocessing_logger()[source]
celery.utils.log.reset_multiprocessing_logger()[source]