Esempio n. 1
0
void CLogOutput::Initialize()
{
	if (initialized) return;

	filePath = CreateFilePath(fileName);
	RotateLogFile();

	filelog = new std::ofstream(filePath.c_str());
	if (filelog->bad())
		SafeDelete(filelog);

	initialized = true;
	InitializeSections();

	std::vector<std::string>::iterator pili;
	for (pili = preInitLog().begin(); pili != preInitLog().end(); ++pili) {
		ToFile(*pili);
	}
	preInitLog().clear();

	LOG("LogOutput initialized.");
	LOG("Spring %s", SpringVersion::GetFull().c_str());
	LOG("Build date/time: %s", SpringVersion::GetBuildTime().c_str());
	LOG("Build environment: %s", SpringVersion::GetBuildEnvironment().c_str());
	LOG("Compiler: %s", SpringVersion::GetCompiler().c_str());
}
Esempio n. 2
0
void CLogOutput::Initialize()
{
    if (initialized) return;

    filePath = CreateFilePath(fileName);
    RotateLogFile();

    /*filelog = new std::ofstream(filePath.c_str());
    if (filelog->bad())
    	SafeDelete(filelog);*/
    const bool flush = configHandler->GetBool("LogFlush");
    log_file_addLogFile(filePath.c_str(), NULL, LOG_LEVEL_ALL, flush);

    initialized = true;
    InitializeSections();

    /*std::vector<std::string>::iterator pili;
    for (pili = preInitLog().begin(); pili != preInitLog().end(); ++pili) {
    	ToFile(*pili);
    }
    preInitLog().clear();*/

    LOG("LogOutput initialized.");
    LOG("Spring %s", SpringVersion::GetFull().c_str());
    LOG("Build date/time: %s", SpringVersion::GetBuildTime().c_str());
    LOG("Build environment: %s", SpringVersion::GetBuildEnvironment().c_str());
    LOG("Compiler: %s", SpringVersion::GetCompiler().c_str());
}
Esempio n. 3
0
void CLogOutput::Initialize()
{
    assert(configHandler != NULL);

    if (IsInitialized())
        return;

    filePath = CreateFilePath(fileName);

    if (configHandler->GetBool("RotateLogFiles"))
        RotateLogFile();

    log_file_addLogFile(filePath.c_str(), NULL, LOG_LEVEL_ALL, configHandler->GetInt("LogFlushLevel"));
    InitializeLogSections();

    LOG("LogOutput initialized.");
}
Esempio n. 4
0
/*!
 * Signal handler to reset the logging level.
 *
 * Reset the logging level and disable thread id logging.
 *
 * \note This handler has the side-effect of rotating and reopening
 *       MR-AFS style logs.
 */
void
ResetDebug_Signal(int signo)
{
    LogLevel = 0;

#if defined(AFS_PTHREAD_ENV)
    DebugOn((void *)(intptr_t)LogLevel);
#else /* AFS_PTHREAD_ENV */
    IOMGR_SoftSig(DebugOn, (void *)(intptr_t)LogLevel);
#endif /* AFS_PTHREAD_ENV */

    if (resetSignals) {
	/* When pthreaded softsig handlers are not in use, some platforms
	 * require this signal handler to be set again. */
	(void)signal(signo, ResetDebug_Signal);
    }
#if defined(AFS_PTHREAD_ENV)
    if (threadIdLogs == 1)
        threadIdLogs = 0;
#endif
    if (serverLogOpts.lopt_rotateOnReset) {
	RotateLogFile();
    }
}				/*ResetDebug_Signal */