def METHOD_NAME(app, category: str, event: str, message: str, user: str, customers: List[str], scopes: List[str],
         resource_id: str, type: str, request: Any, **extra: Any) -> str:
    def get_redacted_data(r):
        data = r.get_json(silent=True)
        if data and app.config['AUDIT_LOG_REDACT']:
            if 'password' in data:
                data['password'] = '[REDACTED]'
        if app.config['AUDIT_LOG_JSON']:
            return data
        return json.dumps(data)
    return json.dumps({
        'id': str(uuid.uuid4()),
        '@timestamp': datetime.utcnow(),
        'event': event,
        'category': category,
        'message': message,
        'user': {
            'id': user,
            'customers': customers,
            'scopes': scopes
        },
        'resource': {
            'id': resource_id,
            'type': type
        },
        'request': {
            'id': g.request_id if hasattr(g, 'request_id') else None,
            'endpoint': request.endpoint,
            'method': request.method,
            'url': request.url,
            'args': request.args.to_dict(),
            'data': get_redacted_data(request),
            'remoteIp': request.remote_addr,
            'userAgent': request.headers.get('User-Agent')
        },
        'extra': extra
    }, cls=CustomJSONEncoder)