How to log message with GenerateStackTrace enabled using a data transform ?
Using @pxLogMessage() we can only supply the message & Log Level. However there is no option to chose whether to generate StackTrace or not. Can someone help if this is feasible ?
So that specific function is not going to output a Stacktrace. To output a Stacktrace using Log4j , oLog object usually, it’s pretty simple:
oLog.(, new Throwable());
You will get the message plus a stack trace.
Since you want to call this from a data transform you would have to create your own Rule-Utility-Function to handle this as there is no OTB function to that will output the message with a stack trace.
This is something I think we should have in the OTB as a new function like pxLogMessageWithStack().
Correct, at this time you will need to create you’re own Rule-Utility-Function and use the code above to handle outputting the a log message with a stack trace.