WintermutationOriginal post
Rank 2: Process
In the past I had an Appwrite log handler class that worked fine:
Plain text
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?
Summary
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.