from celery.utils.log import get_task_logger

def my_func_called_inside_a_task(celery_callback=None):
    if celery_callback:
        logger = get_task_logger(__name__)
Celery Logging: consistent way to log inside and outside of a task