Exception when creating items with preset IDs

Move the logger declaration up, to prevent it from crashing when creating items that already have ID's (usefull when loading fixtures in the DB)