cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

This product reached the end of support date on March 31, 2021.

Log method with parameter

oscarata
Guide

Can i log a parameter that comes from a call to a method with parameter? i mean this method void callString(String pepito) i want to log the letter in position 9 of the string pepito, so i need to call pepito.charAt(9)

i havent been able to do this 😞

3 REPLIES 3

adam_gardner
Dynatrace Champion
Dynatrace Champion

Have you tried the transformation regex option inside the method argument value?

Something like: ([a-z]){3} would match c in abcde

I would keep a very close eye on the performance impact of this regex!

oscarata
Guide

i was putting a simil .. it is hashmap and i want to get some parameter from the hashmap ..... so it would be hasmap.get("parameter") but it was a bit more difficult to explain

Mike_L
Dynatrace Pro
Dynatrace Pro

Hi Oscar,

You cannot use accessors which contain an argument. The best way to solve it is look for the value in another method or, if it is your source code, change the code to add a small method called something like toDynatrace. You can then pass in the value there as a primitive or String argument, after which you put a sensor on that method instead.

Mike