diff --git a/news/109.bugfix b/news/109.bugfix
new file mode 100644
index 0000000..ae935a2
--- /dev/null
+++ b/news/109.bugfix
@@ -0,0 +1,1 @@
+The debug messages issued when a non existent behavior is recorded in an FTI have been improved [ale-rt]
diff --git a/plone/dexterity/schema.py b/plone/dexterity/schema.py
index 93565ea..9d0afa8 100644
--- a/plone/dexterity/schema.py
+++ b/plone/dexterity/schema.py
@@ -136,10 +136,11 @@ class SchemaCache(object):
             if registration is None:
                 # BBB - this case should be deprecated in v 3.0
                 warnings.warn(
-                    'No behavior registration found for behavior named: "{0}"'
+                    'No behavior registration found for behavior named "{0}"'
+                    ' for factory "{1}"'
                     ' - trying deprecated fallback lookup (will be removed '
                     'in 3.0)..."'.format(
-                        behavior_name
+                        behavior_name, fti.getId()
                     ),
                     DeprecationWarning,
                 )
@@ -147,8 +148,8 @@ class SchemaCache(object):
                     schema_interface = resolve(behavior_name)
                 except (ValueError, ImportError):
                     log.error(
-                        "Error resolving behavior {0}".format(
-                            behavior_name
+                        "Error resolving behavior {0} for factory {1}".format(
+                            behavior_name, fti.getId()
                         )
                     )
                     continue

Better warnings for unexistent behaviors
If in my fti I have registered some behavior which is not existent anymore I can read in the logs:
```
... WARNING plone.dexterity.schema No behavior registration found for behavior named: "foo.IBar" - trying fallback lookup..."
... ERROR plone.dexterity.schema Error resolving foo.IBar
```
I think the messages can be improved by reporting the fti for which this is happening.
This will allow help the developer understand better how to debug/fix the problem.  
diff --git a/plone/dexterity/tests/test_schema_cache.py b/plone/dexterity/tests/test_schema_cache.py
index 5429b31..9d901e3 100644
--- a/plone/dexterity/tests/test_schema_cache.py
+++ b/plone/dexterity/tests/test_schema_cache.py
@@ -1,12 +1,14 @@
 # -*- coding: utf-8 -*-
 from .case import MockTestCase
 from mock import Mock
+from mock import patch
 from plone.dexterity.fti import DexterityFTI
 from plone.dexterity.interfaces import IDexterityFTI
 from plone.dexterity.schema import SCHEMA_CACHE
 from zope.interface import Interface
 
 import unittest
+import warnings
 
 
 class TestSchemaCache(MockTestCase):
@@ -57,6 +59,25 @@ class TestSchemaCache(MockTestCase):
 
         self.assertTrue(r1[0] is r2[0] is registration)
 
+    def test_unexistent_behaviors_lookup(self):
+        fti = DexterityFTI(u"testtype")
+        self.mock_utility(fti, IDexterityFTI, name=u"testtype")
+        # Set an unregistered behavior
+        fti.behaviors = ["foo.bar"]
+
+        with patch("warnings.warn") as mock_warnings:
+            warning_list = [call[1][0] for call in mock_warnings.mock_calls]
+            SCHEMA_CACHE.behavior_registrations(u'testtype')
+            # Verify the warning has been issued
+            self.assertEqual(
+                mock_warnings.mock_calls[-1].args[0],
+                (
+                    'No behavior registration found for behavior named '
+                    '"foo.bar" for factory "testtype" - trying deprecated '
+                    'fallback lookup (will be removed in 3.0)..."'
+                )
+            )
+
     def test_repeated_subtypes_lookup(self):
 
         fti = DexterityFTI(u"testtype")

pip install -e .[test]
parse_log_pytest
requirements.txt
pytest plone.testing Products.CMFPlone mock
3.7
requirements/base.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
AccessControl==6.3
Acquisition==5.2
attrs==24.2.0
AuthEncoding==5.0
backports.zoneinfo==0.2.1
beautifulsoup4==4.13.3
borg.localrole==3.1.9
BTrees==5.2
calmjs.parse==1.3.3
certifi @ file:///croot/certifi_1671487769961/work/certifi
cffi==1.15.1
Chameleon==4.2.0
collective.monkeypatcher==1.2.2
cssselect==1.2.0
DateTime==5.5
decorator==5.1.1
diazo==1.5.0
DocumentTemplate==4.6
docutils==0.20.1
exceptiongroup==1.2.2
ExtensionClass==5.1
feedparser==6.0.11
five.customerize==3.0.0
five.intid==1.2.6
five.localsitemanager==4.0
future==1.0.0
icalendar==5.0.13
importlib-metadata==6.7.0
importlib-resources==5.12.0
iniconfig==2.0.0
jsonschema==4.17.3
lxml==5.3.1
Markdown==3.4.4
Missing==5.0
mock==5.2.0
mockup==4.0.2
MultiMapping==5.0
multipart==1.1.0
packaging==24.0
PasteDeploy==3.1.0
Persistence==4.1
persistent==5.2
piexif==1.1.3
Pillow==9.5.0
pkgutil_resolve_name==1.3.10
plone.alterego==1.1.7
plone.api==1.11.2
plone.app.content==4.0.2
plone.app.contentlisting==2.0.8
plone.app.contentmenu==2.3.4
plone.app.contentrules==4.1.6
plone.app.contenttypes==2.2.3
plone.app.customerize==1.3.12
plone.app.dexterity==2.6.11
plone.app.discussion==4.0.0
plone.app.event==5.0.1
plone.app.i18n==3.0.6
plone.app.intid==1.1.4
plone.app.layout==4.0.1
plone.app.linkintegrity==3.6.2
plone.app.locales==6.0.11
plone.app.lockingbehavior==1.0.7
plone.app.multilingual==5.6.6
plone.app.portlets==4.4.9
plone.app.querystring==2.0.0
plone.app.redirector==2.2.1
plone.app.registry==1.7.9
plone.app.relationfield==2.0.3
plone.app.textfield==1.3.7
plone.app.theming==4.1.8
plone.app.users==3.0.0
plone.app.uuid==2.2.1
plone.app.versioningbehavior==1.4.6
plone.app.viewletmanager==4.0.0
plone.app.vocabularies==4.3.0
plone.app.widgets==4.0.0b1
plone.app.workflow==4.0.4
plone.app.z3cform==3.2.5
plone.autoform==2.0.0
plone.base==1.0.0b5
plone.batching==2.0.0
plone.behavior==1.4.0
plone.browserlayer==3.0.0
plone.caching==1.2.2
plone.contentrules==2.1.3
-e git+https://github.com/plone/plone.dexterity.git@903795b86d148ac8f1eba19332f1ba658bcede98#egg=plone.dexterity
plone.event==1.4.2
plone.folder==3.1.0
plone.formwidget.namedfile==3.0.1
plone.formwidget.recurrence==2.1.5
plone.i18n==4.0.7
plone.indexer==1.0.7
plone.intelligenttext==3.1.0
plone.keyring==3.2.1
plone.locking==2.3.0
plone.memoize==3.0.0
plone.namedfile==6.4.0
plone.outputfilters==5.0.0
plone.portlet.collection==4.0.0
plone.portlet.static==3.1.6
plone.portlets==2.3.3
plone.protect==4.1.8
plone.registry==1.2.1
plone.resource==2.1.4
plone.resourceeditor==3.0.4
plone.rfc822==2.0.2
plone.scale==4.0.1
plone.schema==1.4.0
plone.schemaeditor==4.0.0
plone.session==4.0.0
plone.staticresources==2.0.1
plone.stringinterp==2.0.0
plone.subrequest==2.0.0
plone.supermodel==2.0.0
plone.synchronize==1.0.4
plone.testing==8.0.4
plone.theme==3.0.7
plone.transformchain==2.0.2
plone.uuid==1.0.6
plone.z3cform==2.0.0
plonetheme.barceloneta==2.1.11
pluggy==1.2.0
ply==3.11
Products.BTreeFolder2==5.1
Products.CMFCore==3.5
Products.CMFDiffTool==3.3.3
Products.CMFDynamicViewFTI==6.0.3
Products.CMFEditions==4.0.0
Products.CMFFormController==4.1.4
Products.CMFPlone==5.2.15
Products.CMFQuickInstallerTool==4.0.4
Products.CMFUid==4.2
Products.DateRecurringIndex==3.0.1
Products.DCWorkflow==3.0
Products.ExtendedPathIndex==4.0.1
Products.ExternalMethod==5.0
Products.GenericSetup==3.0.2
Products.isurlinportal==1.2.1
Products.MailHost==5.2
Products.MimetypesRegistry==2.1.9
Products.PlonePAS==7.0.0
Products.PluggableAuthService==3.0
Products.PluginRegistry==2.0
Products.PortalTransforms==3.2.2
Products.PythonScripts==5.0
Products.Sessions==5.0
Products.SiteErrorLog==6.0
Products.StandardCacheManagers==5.0
Products.statusmessages==5.0.5
Products.TemporaryFolder==7.0
Products.ZCatalog==7.1
Products.ZODBMountPoint==2.0
Products.ZopeVersionControl==4.1
pycparser==2.21
pyrsistent==0.19.3
pyScss==1.4.0
pytest==7.4.4
python-dateutil==2.9.0.post0
python-gettext==5.0
pytz==2025.2
Record==4.1
repoze.xmliter==0.6.1
RestrictedPython==7.3
roman==4.2
sgmllib3k==1.0.0
simplejson==3.20.1
six==1.17.0
soupsieve==2.4.1
tempstorage==6.0
tomli==2.0.1
transaction==4.0
typing_extensions==4.7.1
Unidecode==1.3.8
waitress==2.1.2
WebOb==1.8.9
WebTest==3.0.1
WSGIProxy2==0.5.1
z3c.autoinclude==1.0
z3c.caching==3.0
z3c.form==5.1
z3c.formwidget.query==2.0.0
z3c.objpath==2.0
z3c.pt==4.4
z3c.relationfield==1.1
z3c.zcmlhook==2.0
zc.lockfile==3.0.post1
zc.relation==2.0
ZConfig==4.1
zdaemon==5.1
ZEO==6.0.0
zExceptions==5.0
zipp==3.15.0
ZODB==6.0
ZODB3==3.11.0
zodbpickle==3.3
Zope==5.10
zope.annotation==5.0
zope.app.locales==5.0
zope.browser==3.0
zope.browsermenu==5.0
zope.browserpage==5.0
zope.browserresource==5.1
zope.cachedescriptors==5.0
zope.component==6.0
zope.componentvocabulary==2.3.0
zope.configuration==5.0.1
zope.container==5.2
zope.contentprovider==5.0
zope.contenttype==5.1
zope.copy==4.3
zope.datetime==5.0.0
zope.deferredimport==5.0
zope.deprecation==5.0
zope.dottedname==6.0
zope.event==5.0
zope.exceptions==5.1
zope.filerepresentation==6.0
zope.globalrequest==2.0
zope.hookable==6.0
zope.i18n==5.1
zope.i18nmessageid==6.1.0
zope.interface==6.4.post2
zope.intid==5.0
zope.keyreference==6.0
zope.lifecycleevent==5.0
zope.location==5.0
zope.pagetemplate==5.1
zope.processlifetime==3.0
zope.proxy==5.3
zope.ptresource==5.0
zope.publisher==7.0
zope.ramcache==3.0
zope.schema==7.0.1
zope.security==6.2
zope.sendmail==6.2
zope.sequencesort==5.0
zope.site==5.0
zope.size==5.0
zope.structuredtext==5.0
zope.tal==5.0.1
zope.tales==6.0
zope.testbrowser==6.0
zope.testing==5.0.1
zope.traversing==5.0
zope.viewlet==5.0
Zope2==4.0

name: plone.dexterity
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2022.12.7=py37h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - pip=22.3.1=py37h06a4308_0
  - python=3.7.16=h7a1cb2a_0
  - readline=8.2=h5eee18b_0
  - setuptools=65.6.3=py37h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.38.4=py37h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - accesscontrol==6.3
      - acquisition==5.2
      - attrs==24.2.0
      - authencoding==5.0
      - backports-zoneinfo==0.2.1
      - beautifulsoup4==4.13.3
      - borg-localrole==3.1.9
      - btrees==5.2
      - calmjs-parse==1.3.3
      - cffi==1.15.1
      - chameleon==4.2.0
      - collective-monkeypatcher==1.2.2
      - cssselect==1.2.0
      - datetime==5.5
      - decorator==5.1.1
      - diazo==1.5.0
      - documenttemplate==4.6
      - docutils==0.20.1
      - exceptiongroup==1.2.2
      - extensionclass==5.1
      - feedparser==6.0.11
      - five-customerize==3.0.0
      - five-intid==1.2.6
      - five-localsitemanager==4.0
      - future==1.0.0
      - icalendar==5.0.13
      - importlib-metadata==6.7.0
      - importlib-resources==5.12.0
      - iniconfig==2.0.0
      - jsonschema==4.17.3
      - lxml==5.3.1
      - markdown==3.4.4
      - missing==5.0
      - mock==5.2.0
      - mockup==4.0.2
      - multimapping==5.0
      - multipart==1.1.0
      - packaging==24.0
      - pastedeploy==3.1.0
      - persistence==4.1
      - persistent==5.2
      - piexif==1.1.3
      - pillow==9.5.0
      - pkgutil-resolve-name==1.3.10
      - plone-alterego==1.1.7
      - plone-api==1.11.2
      - plone-app-content==4.0.2
      - plone-app-contentlisting==2.0.8
      - plone-app-contentmenu==2.3.4
      - plone-app-contentrules==4.1.6
      - plone-app-contenttypes==2.2.3
      - plone-app-customerize==1.3.12
      - plone-app-dexterity==2.6.11
      - plone-app-discussion==4.0.0
      - plone-app-event==5.0.1
      - plone-app-i18n==3.0.6
      - plone-app-intid==1.1.4
      - plone-app-layout==4.0.1
      - plone-app-linkintegrity==3.6.2
      - plone-app-locales==6.0.11
      - plone-app-lockingbehavior==1.0.7
      - plone-app-multilingual==5.6.6
      - plone-app-portlets==4.4.9
      - plone-app-querystring==2.0.0
      - plone-app-redirector==2.2.1
      - plone-app-registry==1.7.9
      - plone-app-relationfield==2.0.3
      - plone-app-textfield==1.3.7
      - plone-app-theming==4.1.8
      - plone-app-users==3.0.0
      - plone-app-uuid==2.2.1
      - plone-app-versioningbehavior==1.4.6
      - plone-app-viewletmanager==4.0.0
      - plone-app-vocabularies==4.3.0
      - plone-app-widgets==4.0.0b1
      - plone-app-workflow==4.0.4
      - plone-app-z3cform==3.2.5
      - plone-autoform==2.0.0
      - plone-base==1.0.0b5
      - plone-batching==2.0.0
      - plone-behavior==1.4.0
      - plone-browserlayer==3.0.0
      - plone-caching==1.2.2
      - plone-contentrules==2.1.3
      - plone-dexterity==2.9.2.dev0
      - plone-event==1.4.2
      - plone-folder==3.1.0
      - plone-formwidget-namedfile==3.0.1
      - plone-formwidget-recurrence==2.1.5
      - plone-i18n==4.0.7
      - plone-indexer==1.0.7
      - plone-intelligenttext==3.1.0
      - plone-keyring==3.2.1
      - plone-locking==2.3.0
      - plone-memoize==3.0.0
      - plone-namedfile==6.4.0
      - plone-outputfilters==5.0.0
      - plone-portlet-collection==4.0.0
      - plone-portlet-static==3.1.6
      - plone-portlets==2.3.3
      - plone-protect==4.1.8
      - plone-registry==1.2.1
      - plone-resource==2.1.4
      - plone-resourceeditor==3.0.4
      - plone-rfc822==2.0.2
      - plone-scale==4.0.1
      - plone-schema==1.4.0
      - plone-schemaeditor==4.0.0
      - plone-session==4.0.0
      - plone-staticresources==2.0.1
      - plone-stringinterp==2.0.0
      - plone-subrequest==2.0.0
      - plone-supermodel==2.0.0
      - plone-synchronize==1.0.4
      - plone-testing==8.0.4
      - plone-theme==3.0.7
      - plone-transformchain==2.0.2
      - plone-uuid==1.0.6
      - plone-z3cform==2.0.0
      - plonetheme-barceloneta==2.1.11
      - pluggy==1.2.0
      - ply==3.11
      - products-btreefolder2==5.1
      - products-cmfcore==3.5
      - products-cmfdifftool==3.3.3
      - products-cmfdynamicviewfti==6.0.3
      - products-cmfeditions==4.0.0
      - products-cmfformcontroller==4.1.4
      - products-cmfplone==5.2.15
      - products-cmfquickinstallertool==4.0.4
      - products-cmfuid==4.2
      - products-daterecurringindex==3.0.1
      - products-dcworkflow==3.0
      - products-extendedpathindex==4.0.1
      - products-externalmethod==5.0
      - products-genericsetup==3.0.2
      - products-isurlinportal==1.2.1
      - products-mailhost==5.2
      - products-mimetypesregistry==2.1.9
      - products-plonepas==7.0.0
      - products-pluggableauthservice==3.0
      - products-pluginregistry==2.0
      - products-portaltransforms==3.2.2
      - products-pythonscripts==5.0
      - products-sessions==5.0
      - products-siteerrorlog==6.0
      - products-standardcachemanagers==5.0
      - products-statusmessages==5.0.5
      - products-temporaryfolder==7.0
      - products-zcatalog==7.1
      - products-zodbmountpoint==2.0
      - products-zopeversioncontrol==4.1
      - pycparser==2.21
      - pyrsistent==0.19.3
      - pyscss==1.4.0
      - pytest==7.4.4
      - python-dateutil==2.9.0.post0
      - python-gettext==5.0
      - pytz==2025.2
      - record==4.1
      - repoze-xmliter==0.6.1
      - restrictedpython==7.3
      - roman==4.2
      - sgmllib3k==1.0.0
      - simplejson==3.20.1
      - six==1.17.0
      - soupsieve==2.4.1
      - tempstorage==6.0
      - tomli==2.0.1
      - transaction==4.0
      - typing-extensions==4.7.1
      - unidecode==1.3.8
      - waitress==2.1.2
      - webob==1.8.9
      - webtest==3.0.1
      - wsgiproxy2==0.5.1
      - z3c-autoinclude==1.0
      - z3c-caching==3.0
      - z3c-form==5.1
      - z3c-formwidget-query==2.0.0
      - z3c-objpath==2.0
      - z3c-pt==4.4
      - z3c-relationfield==1.1
      - z3c-zcmlhook==2.0
      - zc-lockfile==3.0.post1
      - zc-relation==2.0
      - zconfig==4.1
      - zdaemon==5.1
      - zeo==6.0.0
      - zexceptions==5.0
      - zipp==3.15.0
      - zodb==6.0
      - zodb3==3.11.0
      - zodbpickle==3.3
      - zope==5.10
      - zope-annotation==5.0
      - zope-app-locales==5.0
      - zope-browser==3.0
      - zope-browsermenu==5.0
      - zope-browserpage==5.0
      - zope-browserresource==5.1
      - zope-cachedescriptors==5.0
      - zope-component==6.0
      - zope-componentvocabulary==2.3.0
      - zope-configuration==5.0.1
      - zope-container==5.2
      - zope-contentprovider==5.0
      - zope-contenttype==5.1
      - zope-copy==4.3
      - zope-datetime==5.0.0
      - zope-deferredimport==5.0
      - zope-deprecation==5.0
      - zope-dottedname==6.0
      - zope-event==5.0
      - zope-exceptions==5.1
      - zope-filerepresentation==6.0
      - zope-globalrequest==2.0
      - zope-hookable==6.0
      - zope-i18n==5.1
      - zope-i18nmessageid==6.1.0
      - zope-interface==6.4.post2
      - zope-intid==5.0
      - zope-keyreference==6.0
      - zope-lifecycleevent==5.0
      - zope-location==5.0
      - zope-pagetemplate==5.1
      - zope-processlifetime==3.0
      - zope-proxy==5.3
      - zope-ptresource==5.0
      - zope-publisher==7.0
      - zope-ramcache==3.0
      - zope-schema==7.0.1
      - zope-security==6.2
      - zope-sendmail==6.2
      - zope-sequencesort==5.0
      - zope-site==5.0
      - zope-size==5.0
      - zope-structuredtext==5.0
      - zope-tal==5.0.1
      - zope-tales==6.0
      - zope-testbrowser==6.0
      - zope-testing==5.0.1
      - zope-traversing==5.0
      - zope-viewlet==5.0
      - zope2==4.0
prefix: /opt/conda/envs/plone.dexterity

plone/dexterity/tests/test_schema_cache.py::TestSchemaCache::test_unexistent_behaviors_lookup
plone/dexterity/tests/test_schema_cache.py::TestSchemaCache::test_attribute_and_value_error_not_cached plone/dexterity/tests/test_schema_cache.py::TestSchemaCache::test_clear_all_caches plone/dexterity/tests/test_schema_cache.py::TestSchemaCache::test_none_not_cached plone/dexterity/tests/test_schema_cache.py::TestSchemaCache::test_repeated_behavior_registration_lookup plone/dexterity/tests/test_schema_cache.py::TestSchemaCache::test_repeated_get_lookup plone/dexterity/tests/test_schema_cache.py::TestSchemaCache::test_repeated_lookup_with_changed_schema plone/dexterity/tests/test_schema_cache.py::TestSchemaCache::test_repeated_lookup_with_changed_schema_and_invalidation plone/dexterity/tests/test_schema_cache.py::TestSchemaCache::test_repeated_subtypes_lookup plone/dexterity/tests/test_schema_cache.py::TestSchemaCache::test_unknown_type_not_cached
news/109.bugfix plone/dexterity/schema.py
news/109.bugfix plone/dexterity/schema.py