Example #1
0
void TSAppSrvFun::LogReqRes(const TStrKdV& FldNmValPrV, const PHttpResp& HttpResp)
{
	if (LogRqFolder == "")
		return;
	try	 {
		TDir::GenDir(LogRqFolder);
		TStr TimeNow = TTm::GetCurLocTm().GetWebLogDateTimeStr(true);
		TimeNow.ChangeChAll(':', '.');
		PSOut Output = TFOut::New(LogRqFolder + "/" + TimeNow + ".txt", false);
		Output->PutStr(FunNm.CStr()); Output->PutCh('\n');
		for (int N=0; N < FldNmValPrV.Len(); N++)
			Output->PutStrFmt("  %s: %s\n", FldNmValPrV[N].Key.CStr(), FldNmValPrV[N].Dat.CStr());
		Output->PutCh('\n');
		Output->PutStr(HttpResp->GetBodyAsStr(), false);
	} catch (...) {
		/*const PNotify& Notify = RqEnv->GetWebSrv()->GetNotify();
		Notify->OnStatus("Unable to log request for function '" + GetFunNm() + "'!");*/
	}
}