Index: flexoentity/__init__.py
===================================================================
--- flexoentity/__init__.py	(revision bf30018015014e2dd66ac551665ff6d2d17b5793)
+++ flexoentity/__init__.py	(revision 4af65b0c210b58b2d4a18b02cef01cc3caa25a07)
@@ -10,4 +10,8 @@
 from .flexo_entity import FlexoEntity, EntityType, EntityState
 from .domain import Domain
+import logging
+import logging.config
+import os
+from pathlib import Path
 
 __all__ = [
@@ -20,4 +24,24 @@
 ]
 
+# FIXME: change the default log path to /var/log/ammos/ammos.log when system
+# configuration created this dir with the appropriate rights
+
+log_dir = Path(os.environ.get('FLEXO_LOG_DIR', '/tmp/'))
+
+log_path = log_dir / 'flexo.log'
+
+if not log_path.exists():
+    try:
+        log_path.touch()
+    except PermissionError:
+        conf_file = Path(__file__).parent / 'flexo_logging.conf'
+        print("Conf file", conf_file)
+        logging.config.fileConfig(conf_file)
+else:
+    logging.basicConfig(filename=str(log_path), encoding='utf-8', level=logging.DEBUG)
+
+logger = logging.getLogger(__name__)
+
+logger.setLevel(os.environ.get('FLEXO_LOG_LEVEL', logger.getEffectiveLevel()))
 # Optional: keep dynamic version retrieval synced with pyproject.toml
 try:
Index: flexoentity/flexo_entity.py
===================================================================
--- flexoentity/flexo_entity.py	(revision bf30018015014e2dd66ac551665ff6d2d17b5793)
+++ flexoentity/flexo_entity.py	(revision 4af65b0c210b58b2d4a18b02cef01cc3caa25a07)
@@ -75,7 +75,7 @@
     """
     I map a fixed number of entity types to a single unique letter,
-    that structures different types 
+    that structures different types
     """
-    GENERIC =  "G"
+    GENERIC = "G"
     DOMAIN = "D"
     MEDIA = "M"
@@ -288,4 +288,5 @@
             EntityState.PUBLISHED,
         )
+
     def _compute_fingerprint(self) -> str:
         """I always recompute the entity's content fingerprint."""
@@ -302,8 +303,8 @@
             self.fingerprint = new_fp
             self.flexo_id = FlexOID.safe_generate(self.domain_code(),
-                                             self.entity_type.value,
-                                             self.state.value,
-                                             self.text_seed,
-                                             self.flexo_id.version)
+                                                  self.entity_type.value,
+                                                  self.state.value,
+                                                  self.text_seed,
+                                                  self.flexo_id.version)
             return True
         return False
@@ -367,9 +368,9 @@
         if self.state == EntityState.DRAFT:
             new_fid = FlexOID.safe_generate(self.domain_code(),
-                self.entity_type.value,
-                EntityState.APPROVED.value,
-                self.text_seed,
-                version=self.version
-            )
+                                            self.entity_type.value,
+                                            EntityState.APPROVED.value,
+                                            self.text_seed,
+                                            version=self.version
+                                            )
             self.origin = self.flexo_id  # optional: keep audit trail
             self.flexo_id = new_fid
@@ -377,5 +378,4 @@
         raise ValueError("Only drafts can be approved")
 
-
     def sign(self):
         """
@@ -394,5 +394,5 @@
         """
         I move from APPROVED or APPROVED_AND_SIGNED to PUBLISHED.
-        
+
         Uses allowed_transitions() to verify legality,
         then performs a version bump and lineage update.
@@ -469,5 +469,6 @@
             info["stored_fingerprint"] = getattr(entity, "fingerprint", None)
 
-            # Expected ID hash from current seed (should match fid.hash_part if content didn't change)
+            # Expected ID hash from current seed (should match fid.hash_part
+            # if content didn't change)
             exp_hash = FlexOID._blake_hash(canonical_seed(f"{fid.domain}:{fid.entity_type}:{entity.text_seed}"))
             info["expected_id_hash_from_seed"] = exp_hash
@@ -507,5 +508,4 @@
             # --- Fingerprint validation ---
             if hasattr(entity, "fingerprint") and entity.fingerprint:
-                seed = canonical_seed(entity.text_seed)
                 expected_fp = entity._compute_fingerprint()
                 if expected_fp != entity.fingerprint:
Index: flexoentity/flexo_logging.conf
===================================================================
--- flexoentity/flexo_logging.conf	(revision 4af65b0c210b58b2d4a18b02cef01cc3caa25a07)
+++ flexoentity/flexo_logging.conf	(revision 4af65b0c210b58b2d4a18b02cef01cc3caa25a07)
@@ -0,0 +1,21 @@
+[loggers]
+keys=root
+
+[handlers]
+keys=stream_handler
+
+[formatters]
+keys=formatter
+
+[logger_root]
+level=DEBUG
+handlers=stream_handler
+
+[handler_stream_handler]
+class=StreamHandler
+level=DEBUG
+formatter=formatter
+args=(sys.stderr,)
+
+[formatter_formatter]
+format=%(asctime)s %(name)-12s %(levelname)-8s %(message)s
Index: flexoentity/id_factory.py
===================================================================
--- flexoentity/id_factory.py	(revision bf30018015014e2dd66ac551665ff6d2d17b5793)
+++ flexoentity/id_factory.py	(revision 4af65b0c210b58b2d4a18b02cef01cc3caa25a07)
@@ -76,7 +76,5 @@
 import json
 from datetime import datetime, timezone
-from logging import Logger
-
-logger = Logger(__file__)
+from flexoentity import logger
 
 def canonical_seed(obj) -> str:
Index: tests/test_id_lifecycle.py
===================================================================
--- tests/test_id_lifecycle.py	(revision bf30018015014e2dd66ac551665ff6d2d17b5793)
+++ tests/test_id_lifecycle.py	(revision 4af65b0c210b58b2d4a18b02cef01cc3caa25a07)
@@ -79,5 +79,4 @@
     # simulate tampering
     q.text = "Tampered text"
-    print(FlexoEntity.debug_integrity(q))
     assert not FlexoEntity.verify_integrity(q)
 
Index: tests/test_persistance_integrity.py
===================================================================
--- tests/test_persistance_integrity.py	(revision bf30018015014e2dd66ac551665ff6d2d17b5793)
+++ tests/test_persistance_integrity.py	(revision 4af65b0c210b58b2d4a18b02cef01cc3caa25a07)
@@ -34,9 +34,6 @@
     """
     json_str = approved_question.to_json()
-    print("JSON", json_str)
     loaded = SingleChoiceQuestion.from_json(json_str)
 
-    print("Approved", approved_question.text_seed)
-    print("Loaded", loaded.text_seed)
     # Fingerprint and state should match — integrity must pass
     assert SingleChoiceQuestion.verify_integrity(loaded)
