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.Recommended threads
- hey i reallly wanted to know can i make ...
hey i reallly wanted to know can i make a tree database like parent child thing or is it only tables
- Am getting "The current user has been bl...
project id: 68d2c33a003ad875f0a5 i'm not able to login the appwrite console.
- Appwrite Cloud Console down (FRA endpoin...