// testapp.cpp : Defines the entry point for the console application.
//

#define _CRTDBG_MAP_ALLOC
#include "stdafx.h"
#include <log4cxx/logger.h>
#include <log4cxx/basicconfigurator.h>
#include <log4cxx/helpers/exception.h>
#include <log4cxx/ndc.h>
#include <log4cxx/nt/nteventlogappender.h>
#include <log4cxx/simplelayout.h>
#include <log4cxx/fileappender.h>
#include <crtdbg.h>

using namespace std;
using namespace log4cxx;
using namespace log4cxx::helpers;

int main(int argc, char* argv[])
{
    int result = EXIT_SUCCESS;

	_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
	{
		try
		{
			BasicConfigurator::configure();

			Logger *pMylogger = Logger::getLogger(_T("MgmtServer"));
/*
			SimpleLayout *playout = new SimpleLayout();

			FileAppender *pfap = new FileAppender(playout, _T("Simple.log"), false);

			pfap->setName(_T("testAppender1"));

			pMylogger->addAppender(pfap);
*/
			LOG4CXX_INFO(pMylogger, _T("information..."));
			LOG4CXX_WARN(pMylogger, _T("warning..."));

		}

		catch(Exception&)
		{
			result = EXIT_FAILURE;
		}
	}

	_CrtDumpMemoryLeaks();

    return result;
}
