diff --git a/tangostationcontrol/tangostationcontrol/devices/lofar_device.py b/tangostationcontrol/tangostationcontrol/devices/lofar_device.py
index 03a1fff0bc50385c52c304a95f80560b364e40fa..9c85266d43e9fd56e34a46c0c873aceb9ca4d6d9 100644
--- a/tangostationcontrol/tangostationcontrol/devices/lofar_device.py
+++ b/tangostationcontrol/tangostationcontrol/devices/lofar_device.py
@@ -278,7 +278,7 @@ class lofar_device(Device, metaclass=DeviceMeta):
                 default_value = getattr(self, f"{name}_default")
 
                 # set the attribute to the configured default
-                logger.debug(f"Setting attribute {name} to {default_value if len(default_value) < 100 else (default_value[:100] + '...')}")
+                logger.debug(f"Setting attribute {name} to {default_value if len(str(default_value)) < 100 else (default_value[:100] + '...')}")
                 self.proxy.write_attribute(name, default_value)
             except Exception as e:
                 # log which attribute we're addressing