--- a/source/corecollector/logging.d
+++ b/source/corecollector/logging.d
@@ -93,7 +93,10 @@ auto toSyslogLevel(LogLevel lv) @safe
 /// Setup the logging with the supplied logging level.
 void setupLogging(const LogLevel l, File logFile) @safe
 {
-    sharedLog = new SyslogLogger(l, logFile);
+    static if (__VERSION__ < 2101)
+        sharedLog = new SyslogLogger(l, logFile);
+    else
+        sharedLog = (() @trusted => cast(shared) new SyslogLogger(l, logFile))();
 }
 
 @safe unittest
