Back

"Unsupported logs detected"

  • 0
  • Cloud
Wintermutation
22 Feb, 2024, 06:46

In the past I had an Appwrite log handler class that worked fine:

TypeScript
    def __init__(self, context):
        super().__init__()
        self.context = context

    def emit(self, record):
        msg = self.format(record)
        if not self.context:
            return
        if record.levelno == logging.ERROR:
            self.context.error(msg)
        else:
            self.context.log(msg)

logging.getLogger().addHandler(AppwriteLogger(context))

But recently I only get logs for ERROR level and the INFO level fails with "Unsupported logs detected. Use context.log() or context.error() for logging."

logging.error(msg) still works, but logging.info(msg) fails.

Using context.log() still works but I want to have multiple logging actions triggered by one log statement.

Any idea what is causing this?

TL;DR
Developers are experiencing issues with a custom logging handler in an Appwrite application. The logs are only working for the ERROR level and not for INFO. The error message "Unsupported logs detected" suggests using context.log() or context.error() for logging. They want multiple actions triggered by one log statement. Solution: Replace logging.info(msg) with self.context.log(msg) in the custom logging handler to log INFO-level messages.
Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more