def METHOD_NAME(
    project_name,
    channel=None,
    level=logging.INFO,
    PAPERTRAIL_HOST=None,
    PAPERTRAIL_PORT=None,
    SENTRY_DSN=None,
):
    if not channel:
        channel = os.environ.get("APP_CHANNEL")
    logging.basicConfig(
        format="%(asctime)s.%(msecs)06d [%(levelname)-8s] %(filename)s: %(message)s",
        datefmt="%Y-%m-%d %H:%M:%S",
        stream=sys.stdout,
        level=level,
    )
    # Log to papertrail
    if channel and PAPERTRAIL_HOST and PAPERTRAIL_PORT:
        setup_papertrail(project_name, channel, PAPERTRAIL_HOST, PAPERTRAIL_PORT)
    # Log to sentry
    if channel and SENTRY_DSN:
        setup_sentry(project_name, channel, SENTRY_DSN)
    # Setup structlog
    processors = [
        structlog.stdlib.PositionalArgumentsFormatter(),
        structlog.processors.StackInfoRenderer(),
        structlog.processors.format_exc_info,
        RenameAttrsProcessor(),
        # Transpose the 'event_dict' from structlog into keyword arguments for logging.log
        # E.g.: 'event' become 'msg' and, at the end, all remaining values from 'event_dict'
        # are added as 'extra'
        structlog.stdlib.render_to_log_kwargs,
    ]
    structlog.configure(
        processors=processors,
        context_class=structlog.threadlocal.wrap_dict(dict),
        logger_factory=structlog.stdlib.LoggerFactory(),
        wrapper_class=structlog.stdlib.BoundLogger,
        cache_logger_on_first_use=True,
    )