web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

Unable to write complete call stack details using stringWriter or JSONTextWriter as it gets truncated

(0) ShareShare
ReportReport
Posted on by

Hello team 

With below code ,when I write my call stack details from stringWriter OR jsonTextWriter. I see at application insight end  that call stack is truncated  and subsequent write code below callStack ('Txt After writing call stack')   is not written in telemetry.

During debugging I can see truncated value in tootip and in value window of my variable callStack which is source type , and when changed to view with Text visualizer I can see full complete call stack.

What can I do to ensure that my application insight receives the full call stack and not truncated one. 

class myClass
{
 public myMethod()
	{
	
		
        System.IO.StringWriter stringWriter = new System.IO.StringWriter();
        Newtonsoft.Json.JsonTextWriter jsonWriter = new Newtonsoft.Json.JsonTextWriter(stringWriter);
        source callStack = con2Str(xSession::xppCallStack());
        int callStackLength = strLen(callStack);
		
		
		 //Option 1 jsonWriter
        jsonWriter.WriteStartObject();
        jsonWriter.WritePropertyName('JSON Call stack get length of call stack');
        jsonWriter.WriteValue(callStackLength);
        jsonWriter.WritePropertyName('JSON Call stack');
        jsonWriter.WriteValue(callStack);
		jsonWriter.WritePropertyName('JSON After writing call stack');
        jsonWriter.WriteValue('Txt After writing call stack');
		jsonWriter.WriteEndObject(); 
		
		//Option 2 stringWriter
		stringWriter.WriteLine('SW Call stack get length of call stack');
        stringWriter.WriteLine(callStackLength);
        stringWriter.WriteLine('SW Call stack');
        stringWriter.WriteLine(callStack);
       	stringWriter.WriteLine('SW After writing call stack');
        stringWriter.WriteLine('Txt After writing call stack');
		
		SysGlobalTelemetry::logEvent(stringWriter.ToString());
		 
		SysGlobalTelemetry::logMetric(stringWriter.ToString(), timeCounter);
		
	}
}

       
       

I can see the following place from where OOTB system sends full call stack, however cannot see telemeteryclient class detail to figure how actually it is sent.

Thanks

Mav

I have the same question (0)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 551 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 450 Super User 2025 Season 2

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 278 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans