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

Announcements

No record found.

News and Announcements icon
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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

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

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 577 Super User 2026 Season 1

#2
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 309

#3
Diego Mancassola Profile Picture

Diego Mancassola 259

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans