Index: /main/waeup.kofa/trunk/src/waeup/kofa/applicants/batching.py
===================================================================
--- /main/waeup.kofa/trunk/src/waeup/kofa/applicants/batching.py	(revision 8333)
+++ /main/waeup.kofa/trunk/src/waeup/kofa/applicants/batching.py	(revision 8334)
@@ -204,11 +204,8 @@
         parent = self.getParent(row, site)
         parent.addApplicant(obj)
-        # We have to log this if state is provided. If not,
-        # logging is done by the event handler handle_applicant_added
-        if row.has_key('state'):
-            parent.__parent__.logger.info(
-            '%s - Application initialized' % obj.applicant_id)
+        #parent.__parent__.logger.info(
+        #    'Applicant imported: %s' % obj.applicant_id)
         history = IObjectHistory(obj)
-        history.addMessage(_('Application initialized'))
+        history.addMessage(_('Application record imported'))
         return
 
@@ -218,4 +215,6 @@
             parent = applicant.__parent__
             del parent[applicant.application_number]
+            #parent.__parent__.logger.info(
+            #    'Applicant removed: %s' % applicant.applicant_id)
         pass
 
@@ -224,5 +223,4 @@
         """
         items_changed = ''
-
         # Remove application_number from row if empty
         if row.has_key('application_number') and row['application_number'] in (
@@ -235,36 +233,40 @@
             obj.applicant_id = u'%s_%s' % (
                 row['container_code'], row['application_number'])
+            items_changed += ('%s=%s, ' % ('applicant_id', obj.applicant_id))
             row.pop('application_number')
 
         # Update password
-        passwd = row.get('password', IGNORE_MARKER)
-        if passwd not in ('', IGNORE_MARKER):
-            IUserAccount(obj).setPassword(passwd)
+        if row.has_key('password'):
+            passwd = row.get('password', IGNORE_MARKER)
+            if passwd not in ('', IGNORE_MARKER):
+                IUserAccount(obj).setPassword(passwd)
+                items_changed += ('%s=%s, ' % ('password', passwd))
             row.pop('password')
 
         # Update registration state
-        state = row.get('state', IGNORE_MARKER)
-        if state not in (IGNORE_MARKER, ''):
-            value = row['state']
-            IWorkflowState(obj).setState(value)
-            msg = _("State '${a}' set", mapping = {'a':value})
-            history = IObjectHistory(obj)
-            history.addMessage(msg)
+        if row.has_key('state'):
+            state = row.get('state', IGNORE_MARKER)
+            if state not in (IGNORE_MARKER, ''):
+                IWorkflowState(obj).setState(state)
+                msg = _("State '${a}' set", mapping = {'a':state})
+                history = IObjectHistory(obj)
+                history.addMessage(msg)
+                items_changed += ('%s=%s, ' % ('state', state))
             row.pop('state')
 
         # apply other values...
-        items_changed = super(ApplicantProcessor, self).updateEntry(
+        items_changed += super(ApplicantProcessor, self).updateEntry(
             obj, row, site)
 
         # Log actions...
         parent = self.getParent(row, site)
-        if hasattr(obj,'application_number'):
+        if self.getLocator(row) == 'container_code':
             # Update mode: the applicant exists and we can get the applicant_id
             parent.__parent__.logger.info(
-                '%s - Application record updated: %s'
-                % (obj.applicant_id, items_changed))
+                'Applicant imported: %s' % items_changed)
         else:
             # Create mode: the applicant does not yet exist
-            parent.logger.info('Application record imported: %s' % items_changed)
+            parent.__parent__.logger.info(
+                'Applicant updated: %s' % items_changed)
         return items_changed
 
Index: /main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_batching.py
===================================================================
--- /main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_batching.py	(revision 8333)
+++ /main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_batching.py	(revision 8334)
@@ -245,4 +245,7 @@
         open(self.csv_file_update2, 'wb').write(APPLICANT_SAMPLE_DATA_UPDATE2)
 
+        self.logfile = os.path.join(
+            self.app['datacenter'].storage, 'logs', 'applicants.log')
+
     def test_interface(self):
         # Make sure we fulfill the interface contracts.
@@ -289,4 +292,19 @@
         assert applicant.__implemented__.__name__ == (
             'waeup.kofa.applicants.applicant.Applicant')
+        logcontent = open(self.logfile).read()
+        # Logging message from updateEntry,
+        # create applicant with given application_number
+        self.assertTrue(
+            'Applicant imported: applicant_id=dp2011_1234, password=mypwd1, '
+            'reg_number=1001, firstname=Aaren, middlename=Peter, lastname=Pieri, '
+            'sex=m, course1=CERT1, date_of_birth=1990-01-02, email=xx@yy.zz' in
+            logcontent)
+        # create applicant with random application_number which is
+        # not shown in the log file
+        self.assertTrue(
+            'Applicant imported: reg_number=1003, firstname=Aaren, '
+            'middlename=Alfons, lastname=Berson, sex=m, course1=CERT1, '
+            'date_of_birth=1990-01-04, email=xx@yy.zz' in
+            logcontent)
         shutil.rmtree(os.path.dirname(fin_file))
 
@@ -327,7 +345,20 @@
         self.assertTrue(IUserAccount(container['1234']).checkPassword('mypwd1'))
         # password of Finau is still unset
-        self.assertEqual(IUserAccount(container['2345']).password,'')
+        self.assertEqual(IUserAccount(container['2345']).password,None)
         # reg_number of Finau has changed
         self.assertEqual(container['2345'].reg_number, '6666')
+        logcontent = open(self.logfile).read()
+
+        # Logging message from updateEntry,
+        # reg_number is locator
+        self.assertTrue(
+            'Applicant updated: reg_number=1001, firstname=Aaren' in
+            logcontent)
+        # applicant_id is locator
+        self.assertTrue(
+            'Applicant updated: state=admitted, reg_number=6666, '
+            'firstname=Alfons, applicant_id=dp2011_2345' in
+            logcontent)
+
         shutil.rmtree(os.path.dirname(fin_file))
 
@@ -350,3 +381,10 @@
             self.csv_file_update, APPLICANT_HEADER_FIELDS_UPDATE, 'remove')
         self.assertEqual(num_warns,0)
-        shutil.rmtree(os.path.dirname(fin_file))
+        logcontent = open(self.logfile).read()
+
+        # Logging message from handle_applicant_transition_event
+        self.assertTrue(
+            'dp2011_1234 - Applicant record removed' in
+            logcontent)
+
+        shutil.rmtree(os.path.dirname(fin_file))
Index: /main/waeup.kofa/trunk/src/waeup/kofa/applicants/workflow.py
===================================================================
--- /main/waeup.kofa/trunk/src/waeup/kofa/applicants/workflow.py	(revision 8333)
+++ /main/waeup.kofa/trunk/src/waeup/kofa/applicants/workflow.py	(revision 8334)
@@ -170,8 +170,9 @@
     history.addMessage(msg)
     # In some tests we don't have a an applicants root or a user
-    try:
-        applicants_root = grok.getSite()['applicants']
-        applicants_root.logger.info('%s - %s' % (obj.applicant_id,msg))
-    except (TypeError, AttributeError):
-        pass
+    if event.transition.transition_id != 'init':
+        try:
+            applicants_root = grok.getSite()['applicants']
+            applicants_root.logger.info('%s - %s' % (obj.applicant_id,msg))
+        except (TypeError, AttributeError):
+            pass
     return
Index: /main/waeup.kofa/trunk/src/waeup/kofa/utils/converters.py
===================================================================
--- /main/waeup.kofa/trunk/src/waeup/kofa/utils/converters.py	(revision 8333)
+++ /main/waeup.kofa/trunk/src/waeup/kofa/utils/converters.py	(revision 8334)
@@ -302,4 +302,6 @@
         obj = context
         if isinstance(context, basestring):
+            # If we log initialization transitions this
+            # will create another (misleading) log entry
             obj = createObject(context)
 
