Escape backslash and double quotes and other special character's in log4cxx framework

0

I am using log4cxx framework in my application for logging. I am logging each line as json in text(.txt) file.

Sample Json line :

{"timestamp":"2019-03-15 12:51:39,949","severity":"INFO ","threadid":"0x00000000","method":"method1","stacktrace":"..\project\project.cpp(1)","message":{"message":"Test"s message","type":"test type"}}

When i am trying to parse this json line parsing is failed because of backslash in stacktrace and double quotes in message attribute.

I was searching for log4cxx framework options, if the attribute values contain any special characters that can be escaped, but unfortunately I am not getting any default option available in framework for escaping double quotes, backslash, newline, etc. Is there any default configuration is there or we have to escape the characters and have to pass it to the LOG4CXX_INFO and also how we can handle stacktrace value?

json
log4cxx
asked on Stack Overflow Mar 15, 2019 by Aishwarya

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0