Celery v0.8.1 (stable) documentation

This Page

Logging - celery.log

celery.log

class celery.log.LoggingProxy(logger, loglevel=None)

Forward file object to logging.Logger instance.

Parameters:
  • logger – The logging.Logger instance to forward to.
  • loglevel – Loglevel to use when writing messages.
close()
When the object is closed, no write requests are forwarded to the logging object anymore.
flush()
This object is not buffered so any flush() requests are ignored.
isatty()
Always returns False. Just here for file support.
write(data)
Write message to logging object.
writelines(sequence)

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.log.emergency_error(logfile, message)
Emergency error logging, for when there’s no standard file descriptors open because the process has been daemonized or for some other reason.
celery.log.redirect_stdouts_to_logger(logger, loglevel=None)

Redirect sys.stdout and sys.stderr to a logging instance.

Parameters:
  • logger – The logging.Logger instance to redirect to.
  • loglevel – The loglevel redirected messages will be logged as.
celery.log.setup_logger(loglevel=20, logfile=None, format='[, %(asctime)s: %(levelname)s/%(processName)s], %(message)s', **kwargs)

Setup the multiprocessing logger. If logfile is not specified, stderr is used.

Returns logger object.