I am getting the following error when i try to log...
# replication-ask-ai
a
I am getting the following error when i try to log inside the write method on a custom destination connector: line 44, in torq_data_cm self.logger.info(f"Created {vector_index.dict()}!!!") AttributeError: 'DestinationSubclass' object has no attribute 'logger' How do i get the logger object on the Destination class?
k
In Airbyte, all logging should be done through the
self.logger
object available in the
Destination
class. If you're not seeing the
logger
attribute, it's possible that you're not correctly inheriting from the
Destination
class or not properly initializing your class. Here is an example of how you can use the
self.logger
object in your
Destination
class:
Copy code
python class MyDestination(Destination):     def __init__(self):         super().__init__()         <http://self.logger.info|self.logger.info>("MyDestination initialized")
In this example,
MyDestination
is a subclass of
Destination
, and it has access to the
self.logger
object for logging. If you're still having issues, please ensure that your class is correctly inheriting from the
Destination
class and that you're correctly initializing your class. For more information, you can refer to the [Airbyte documentation](https://docs.airbyte.com/connector-development/tutorials/building-a-python-destination).