File tree Expand file tree Collapse file tree 1 file changed +18
-4
lines changed Expand file tree Collapse file tree 1 file changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -330,6 +330,24 @@ - (NSMutableDictionary*) commonBlockDict {
330
330
if (nativePlatform) [commonAttributes setObject: nativePlatform forKey: NRLogMessageInstrumentationCollectorKey];
331
331
if (nrAppId) [commonAttributes setObject: nrAppId forKey: NRLogMessageAppIdKey];
332
332
333
+
334
+ NSString * sessionAttributes = [[NewRelicAgentInternal sharedInstance ].analyticsController sessionAttributeJSONString ];
335
+ if (sessionAttributes != nil && [sessionAttributes length ] > 0 ) {
336
+ NSDictionary * dictionary = [NSJSONSerialization JSONObjectWithData: [sessionAttributes dataUsingEncoding: NSUTF8StringEncoding]
337
+ options: 0
338
+ error: nil ];
339
+ for (NSString *key in dictionary) {
340
+ id value = [dictionary objectForKey: key];
341
+
342
+
343
+ if (value) {
344
+ [commonAttributes setObject: value forKey: key];
345
+ }
346
+ }
347
+ }
348
+
349
+
350
+
333
351
return commonAttributes;
334
352
}
335
353
@@ -598,7 +616,6 @@ - (void) processNextUploadTask {
598
616
NSData *formattedData = [self ->uploadQueue firstObject ];
599
617
600
618
if (self->debugLogs ) {
601
- // NSString* logMessagesJson = [NSString stringWithFormat:@"[ %@ ]", [[NSString alloc] initWithData:formattedData encoding:NSUTF8StringEncoding]];
602
619
NSArray * decode = [NSJSONSerialization JSONObjectWithData: formattedData
603
620
options: 0
604
621
error: nil ];
@@ -609,9 +626,6 @@ - (void) processNextUploadTask {
609
626
NSMutableURLRequest * req = [NSMutableURLRequest requestWithURL: [NSURL URLWithString: self ->logURL]];
610
627
[req setValue: self ->logIngestKey forHTTPHeaderField: @" X-App-License-Key" ];
611
628
[req setValue: @" application/json" forHTTPHeaderField: @" Content-Type" ];
612
-
613
- // NSString* contentEncoding = message.length <= 512 ? kNRMAIdentityHeader : kNRMAGZipHeader;
614
-
615
629
[req setValue: kNRMAGZipHeader forHTTPHeaderField: kNRMAContentEncodingHeader ];
616
630
617
631
req.HTTPMethod = @" POST" ;
You can’t perform that action at this time.
0 commit comments