<#3549 [BUG] Flyte's internal logger logs as error...
# flyte-github
a
#3549 [BUG] Flyte's internal logger logs as error before user code is run Issue created by ggydush Describe the bug When running Flyte on GCP, severity is marked as ERROR for all logs before user code is run. In my user code, I have something like the following that correctly marks severity:
Copy code
class CustomJsonFormatter(jsonlogger.JsonFormatter):
    def add_fields(
        self, log_record: dict, record: logging.LogRecord, message_dict: dict
    ) -> None:
        super().add_fields(log_record, record, message_dict)
        log_record["severity"] = record.levelname
This works after user code is loaded, but all logs that are output before user code is run are still formatted incorrectly (see screenshot).

image

Expected behavior Flyte's internal logs set severity to level that matches log record. Additional context to reproduce No response Screenshots No response Are you sure this issue hasn't been raised already? ☑︎ Yes Have you read the Code of Conduct? ☑︎ Yes flyteorg/flyte