diff --git a/src/cell.c b/src/cell.c
index 3c6d6e4507b9a175e1741f0bd7b60c6726279c0d..d174ac09c42233548dfda2cf096899ea47fb7682 100644
--- a/src/cell.c
+++ b/src/cell.c
@@ -3501,7 +3501,9 @@ int cell_unskip_hydro_tasks(struct cell *c, struct scheduler *s) {
     if (c->timestep != NULL) scheduler_activate(s, c->timestep);
     if (c->hydro.end_force != NULL) scheduler_activate(s, c->hydro.end_force);
     if (c->hydro.cooling != NULL) scheduler_activate(s, c->hydro.cooling);
+#ifdef WITH_LOGGER
     if (c->logger != NULL) scheduler_activate(s, c->logger);
+#endif
 
     if (c->top->hydro.star_formation != NULL) {
       cell_activate_star_formation_tasks(c->top, s);
@@ -3656,7 +3658,9 @@ int cell_unskip_gravity_tasks(struct cell *c, struct scheduler *s) {
     if (c->grav.mesh != NULL) scheduler_activate(s, c->grav.mesh);
     if (c->grav.long_range != NULL) scheduler_activate(s, c->grav.long_range);
     if (c->grav.end_force != NULL) scheduler_activate(s, c->grav.end_force);
+#ifdef WITH_LOGGER
     if (c->logger != NULL) scheduler_activate(s, c->logger);
+#endif
   }
 
   return rebuild;
@@ -3898,7 +3902,9 @@ int cell_unskip_stars_tasks(struct cell *c, struct scheduler *s,
       if (c->kick1 != NULL) scheduler_activate(s, c->kick1);
       if (c->kick2 != NULL) scheduler_activate(s, c->kick2);
       if (c->timestep != NULL) scheduler_activate(s, c->timestep);
-      if (c->logger != NULL) scheduler_activate(s, c->logger);
+#ifdef WITH_LOGGER
+    if (c->logger != NULL) scheduler_activate(s, c->logger);
+#endif
     }
   }
 
@@ -4176,7 +4182,9 @@ int cell_unskip_black_holes_tasks(struct cell *c, struct scheduler *s) {
     if (c->kick1 != NULL) scheduler_activate(s, c->kick1);
     if (c->kick2 != NULL) scheduler_activate(s, c->kick2);
     if (c->timestep != NULL) scheduler_activate(s, c->timestep);
+#ifdef WITH_LOGGER
     if (c->logger != NULL) scheduler_activate(s, c->logger);
+#endif
   }
 
   return rebuild;
diff --git a/src/cell.h b/src/cell.h
index f59576b4fc303580fc37db31e2fecb707ec774e6..be54c886eef3aa121ea02dbb86a97c2ce2bc5f83 100644
--- a/src/cell.h
+++ b/src/cell.h
@@ -755,8 +755,10 @@ struct cell {
   /*! The task to limit the time-step of inactive particles */
   struct task *timestep_limiter;
 
-  /*! The logger task */
-  struct task *logger;
+#ifdef WITH_LOGGER
+    /*! The logger task */
+    struct task *logger;
+#endif
 
   /*! Minimum dimension, i.e. smallest edge of this cell (min(width)). */
   float dmin;