From 0fb397eabdfbf0977dc60419d691cf671c9327bc Mon Sep 17 00:00:00 2001 From: Jan Steemann Date: Wed, 6 Mar 2013 19:05:17 +0100 Subject: [PATCH] adjusted startup output to be more compact, less verbose --- CHANGELOG | 2 + arangod/RestServer/ArangoServer.cpp | 39 +++++++++----- arangod/V8Server/ApplicationV8.cpp | 54 +++++++++++--------- lib/Admin/ApplicationAdminServer.cpp | 2 +- lib/ApplicationServer/ApplicationServer.cpp | 2 +- lib/HttpServer/ApplicationEndpointServer.cpp | 20 +++++--- lib/HttpServer/ApplicationEndpointServer.h | 7 +++ 7 files changed, 80 insertions(+), 46 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 74433d92a5..15eb31fe89 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,8 @@ v1.3 (XXXX-XX-XX) ----------------- +* adjust startup log output to be more compact, less verbose + * set the required minimum number of file descriptors to 256. On server start, this number is enforced on systems that have rlimit. If the limit cannot be enforced, starting the server will fail. diff --git a/arangod/RestServer/ArangoServer.cpp b/arangod/RestServer/ArangoServer.cpp index 32f41afff0..a26f47b0cb 100644 --- a/arangod/RestServer/ArangoServer.cpp +++ b/arangod/RestServer/ArangoServer.cpp @@ -383,7 +383,8 @@ void ArangoServer::buildApplicationServer () { "arangodb", TRI_CheckAuthenticationAuthInfo); _applicationServer->addFeature(_applicationEndpointServer); - + + // ............................................................................. // parse the command line options - exit if there is a parse error // ............................................................................. @@ -392,31 +393,44 @@ void ArangoServer::buildApplicationServer () { CLEANUP_LOGGING_AND_EXIT_ON_FATAL_ERROR(); } - // ............................................................................. - // set language of default collator - // ............................................................................. - + UVersionInfo icuVersion; char icuVersionString[U_MAX_VERSION_STRING_LENGTH]; u_getVersion(icuVersion); u_versionToString(icuVersion, icuVersionString); - LOGGER_INFO("using ICU " << icuVersionString); + + + // dump versions of important components + LOGGER_INFO("ArangoDB " << TRIAGENS_VERSION << " -- " << + "ICU " << icuVersionString << ", " << + "V8 version " << v8::V8::GetVersion() << ", " + "SSL engine " << ApplicationEndpointServer::getSslVersion()); + + + // ............................................................................. + // set language of default collator + // ............................................................................. + + string languageName; Utf8Helper::DefaultUtf8Helper.setCollatorLanguage(_defaultLanguage); if (Utf8Helper::DefaultUtf8Helper.getCollatorCountry() != "") { - LOGGER_INFO("using default language '" << Utf8Helper::DefaultUtf8Helper.getCollatorLanguage() << "_" << Utf8Helper::DefaultUtf8Helper.getCollatorCountry() << "'"); + languageName = string(Utf8Helper::DefaultUtf8Helper.getCollatorLanguage() + "_" + Utf8Helper::DefaultUtf8Helper.getCollatorCountry()); +// LOGGER_INFO("using default language '" << Utf8Helper::DefaultUtf8Helper.getCollatorLanguage() << "_" << Utf8Helper::DefaultUtf8Helper.getCollatorCountry() << "'"); } else { - LOGGER_INFO("using default language '" << Utf8Helper::DefaultUtf8Helper.getCollatorLanguage() << "'" ); + languageName = Utf8Helper::DefaultUtf8Helper.getCollatorLanguage(); + //LOGGER_INFO("using default language '" << Utf8Helper::DefaultUtf8Helper.getCollatorLanguage() << "'" ); } + // ............................................................................. // init nonces // ............................................................................. - uint32_t optionNonceHashSize = 0; // TODO: add an server option + uint32_t optionNonceHashSize = 0; // TODO: add a server option if (optionNonceHashSize > 0) { - LOGGER_INFO("setting nonce hash size to '" << optionNonceHashSize << "'" ); + LOGGER_DEBUG("setting nonce hash size to '" << optionNonceHashSize << "'" ); Nonce::create(optionNonceHashSize); } @@ -455,6 +469,8 @@ void ArangoServer::buildApplicationServer () { LOGGER_FATAL_AND_EXIT("no database path has been supplied, giving up"); } + LOGGER_INFO("using default language '" << languageName << "'"); + OperationMode::server_operation_mode_e mode = OperationMode::determineMode(_applicationServer->programOptions()); if (mode == OperationMode::MODE_CONSOLE || @@ -594,8 +610,7 @@ int ArangoServer::startupServer () { _applicationServer->start(); - LOGGER_INFO("ArangoDB (version " << TRIAGENS_VERSION << ") is ready for business"); - LOGGER_INFO("Have Fun!"); + LOGGER_INFO("ArangoDB (version " << TRIAGENS_VERSION << ") is ready for business. Have fun!"); _applicationServer->wait(); diff --git a/arangod/V8Server/ApplicationV8.cpp b/arangod/V8Server/ApplicationV8.cpp index e8d5385eb2..075c7362d5 100644 --- a/arangod/V8Server/ApplicationV8.cpp +++ b/arangod/V8Server/ApplicationV8.cpp @@ -29,6 +29,7 @@ #include "Basics/ConditionLocker.h" #include "Basics/ReadLocker.h" +#include "Basics/StringUtils.h" #include "Basics/WriteLocker.h" #include "Logger/Logger.h" #include "V8/v8-conv.h" @@ -523,45 +524,43 @@ void ApplicationV8::setupOptions (map //////////////////////////////////////////////////////////////////////////////// bool ApplicationV8::prepare () { - LOGGER_DEBUG("V8 version: " << v8::V8::GetVersion()); - - // use a minimum of 1 second for GC - if (_gcFrequency < 1) { - _gcFrequency = 1; - } - // check the startup modules if (_startupModules.empty()) { LOGGER_FATAL_AND_EXIT("no 'javascript.modules-path' has been supplied, giving up"); } - else { - LOGGER_INFO("using JavaScript modules path '" << _startupModules << "'"); - } - - if (! _startupNodeModules.empty()) { - LOGGER_INFO("using Node modules path '" << _startupNodeModules << "'"); - } // set up the startup loader if (_startupPath.empty()) { LOGGER_FATAL_AND_EXIT("no 'javascript.startup-directory' has been supplied, giving up"); } - else { - LOGGER_INFO("using JavaScript startup files at '" << _startupPath << "'"); - _startupLoader.setDirectory(_startupPath); + + // set the actions path + if (_useActions && _actionPath.empty()) { + LOGGER_FATAL_AND_EXIT("no 'javascript.action-directory' has been supplied, giving up"); } + // dump paths + { + vector paths; + + paths.push_back(string("Javascript startup path '" + _startupPath + "'")); + paths.push_back(string("Javascript modules path '" + _startupModules + "'")); + if (! _startupNodeModules.empty()) { + paths.push_back(string("Node modules path '" + _startupNodeModules + "'")); + } + if (_useActions) { + paths.push_back(string("Javascript action path '" + _actionPath + "'")); + } + + LOGGER_INFO("using " << StringUtils::join(paths, ", ")); + } + + _startupLoader.setDirectory(_startupPath); + // set up action loader if (_useActions) { - if (_actionPath.empty()) { - LOGGER_FATAL_AND_EXIT("no 'javascript.action-directory' has been supplied, giving up"); - } - else { - LOGGER_INFO("using JavaScript action files at '" << _actionPath << "'"); - - _actionLoader.setDirectory(_actionPath); - } + _actionLoader.setDirectory(_actionPath); } // add v8 options @@ -569,6 +568,11 @@ bool ApplicationV8::prepare () { LOGGER_INFO("using V8 options '" << _v8Options << "'"); v8::V8::SetFlagsFromString(_v8Options.c_str(), _v8Options.size()); } + + // use a minimum of 1 second for GC + if (_gcFrequency < 1) { + _gcFrequency = 1; + } // setup instances _contexts = new V8Context*[_nrInstances]; diff --git a/lib/Admin/ApplicationAdminServer.cpp b/lib/Admin/ApplicationAdminServer.cpp index 3ac1668508..0b57e0e7dd 100644 --- a/lib/Admin/ApplicationAdminServer.cpp +++ b/lib/Admin/ApplicationAdminServer.cpp @@ -216,7 +216,7 @@ void ApplicationAdminServer::addHandlers (HttpHandlerFactory* factory, string co // ............................................................................. if (_allowAdminDirectory) { - LOGGER_INFO("using JavaScript front-end files stored at '" << _adminDirectory << "'"); + LOGGER_DEBUG("using JavaScript front-end path '" << _adminDirectory << "'"); reinterpret_cast(_pathOptions)->path = _adminDirectory; reinterpret_cast(_pathOptions)->contentType = "text/plain"; diff --git a/lib/ApplicationServer/ApplicationServer.cpp b/lib/ApplicationServer/ApplicationServer.cpp index 1b78433551..f27ca69ff5 100644 --- a/lib/ApplicationServer/ApplicationServer.cpp +++ b/lib/ApplicationServer/ApplicationServer.cpp @@ -980,7 +980,7 @@ bool ApplicationServer::readConfigurationFile () { } else { - LOGGER_INFO("no user init file '" << homeDir << "' found"); + LOGGER_DEBUG("no user init file '" << homeDir << "' found"); } } diff --git a/lib/HttpServer/ApplicationEndpointServer.cpp b/lib/HttpServer/ApplicationEndpointServer.cpp index b47089ac31..44dcb93149 100644 --- a/lib/HttpServer/ApplicationEndpointServer.cpp +++ b/lib/HttpServer/ApplicationEndpointServer.cpp @@ -138,6 +138,14 @@ ApplicationEndpointServer::~ApplicationEndpointServer () { /// @addtogroup Scheduler /// @{ //////////////////////////////////////////////////////////////////////////////// + +//////////////////////////////////////////////////////////////////////////////// +/// @brief return the SSL engine version number +//////////////////////////////////////////////////////////////////////////////// + +std::string ApplicationEndpointServer::getSslVersion () { + return OPENSSL_VERSION_TEXT; +} //////////////////////////////////////////////////////////////////////////////// /// @brief builds the endpoint servers @@ -277,9 +285,6 @@ bool ApplicationEndpointServer::parsePhase2 (ProgramOptions& options) { } } - // dump used endpoints for user information - _endpointList.dump(); - // and return return true; } @@ -289,6 +294,9 @@ bool ApplicationEndpointServer::parsePhase2 (ProgramOptions& options) { //////////////////////////////////////////////////////////////////////////////// bool ApplicationEndpointServer::prepare () { + // dump used endpoints for user information + _endpointList.dump(); + _handlerFactory = new HttpHandlerFactory(_authenticationRealm, _checkAuthentication); return true; @@ -375,8 +383,6 @@ void ApplicationEndpointServer::stop () { //////////////////////////////////////////////////////////////////////////////// bool ApplicationEndpointServer::createSslContext () { - LOGGER_INFO("using " << OPENSSL_VERSION_TEXT); - // check keyfile if (_httpsKeyfile.empty()) { return true; @@ -389,7 +395,7 @@ bool ApplicationEndpointServer::createSslContext () { return false; } - LOGGER_INFO("using SSL protocol version '" << HttpsServer::protocolName((HttpsServer::protocol_e) _sslProtocol) << "'"); + LOGGER_DEBUG("using SSL protocol version '" << HttpsServer::protocolName((HttpsServer::protocol_e) _sslProtocol) << "'"); // create context _sslContext = HttpsServer::sslContext(HttpsServer::protocol_e(_sslProtocol), _httpsKeyfile); @@ -402,7 +408,7 @@ bool ApplicationEndpointServer::createSslContext () { // set cache mode SSL_CTX_set_session_cache_mode(_sslContext, _sslCache ? SSL_SESS_CACHE_SERVER : SSL_SESS_CACHE_OFF); if (_sslCache) { - LOGGER_INFO("using SSL session caching"); + LOGGER_TRACE("using SSL session caching"); } // set options diff --git a/lib/HttpServer/ApplicationEndpointServer.h b/lib/HttpServer/ApplicationEndpointServer.h index 09b4b6bfd8..d8c69ae190 100644 --- a/lib/HttpServer/ApplicationEndpointServer.h +++ b/lib/HttpServer/ApplicationEndpointServer.h @@ -109,6 +109,13 @@ namespace triagens { public: +//////////////////////////////////////////////////////////////////////////////// +/// @brief return the SSL engine version number +//////////////////////////////////////////////////////////////////////////////// + + static std::string getSslVersion (); + + //////////////////////////////////////////////////////////////////////////////// /// @brief builds the servers ////////////////////////////////////////////////////////////////////////////////