Hello,
I have written a server method. If any error or exception came in method, I want to add it to logs. Is there any to do the same? If yes please explain how to do it.
Thank you,
Nilesh
Hello,
I have written a server method. If any error or exception came in method, I want to add it to logs. Is there any to do the same? If yes please explain how to do it.
Thank you,
Nilesh
Hello Nilesh,
You can use try catch block in you method & in catch block you can log (using Aras log method) your exception or error like CCO.Utilities.WriteDebug("logFileName","Error");.
log will generate server temp folder with logFileName
try
{
// your code
}
catch(Exception ex)
{
CCO.Utilities.WriteDebug("logFilename",ex.ToString());
}
return this;.
Regards,
Suhas
Hello Nilesh,
You can use try catch block in you method & in catch block you can log (using Aras log method) your exception or error like CCO.Utilities.WriteDebug("logFileName","Error");.
log will generate server temp folder with logFileName
try
{
// your code
}
catch(Exception ex)
{
CCO.Utilities.WriteDebug("logFilename",ex.ToString());
}
return this;.
Regards,
Suhas