diff --git a/spectrum/src/main.cpp b/spectrum/src/main.cpp index 7efe1e98a1ec2b40daf30602a482d924e7ab95ca..75169b1a548d76cb3746196d14bc9b453d434460 100644 --- a/spectrum/src/main.cpp +++ b/spectrum/src/main.cpp @@ -315,6 +315,7 @@ int main(int argc, char **argv) } #endif + Logging::initMainLogging(&config); #ifndef WIN32 if (!CONFIG_STRING(&config, "service.group").empty() ||!CONFIG_STRING(&config, "service.user").empty() ) { @@ -377,9 +378,7 @@ int main(int argc, char **argv) return -1; } - // Logging has to be initialized after all std:cerr output here, because - // it forwards std::cerr to log file. - Logging::initMainLogging(&config); + Logging::redirect_stderr(); UserManager userManager(&transport, &userRegistry, storageBackend); userManager_ = &userManager;