18 #ifndef _LOG4CXX_JSON_LAYOUT_H 19 #define _LOG4CXX_JSON_LAYOUT_H 21 #include <log4cxx/layout.h> 22 #include <log4cxx/helpers/iso8601dateformat.h> 23 #include <log4cxx/spi/loggingevent.h> 26 #pragma warning ( push ) 27 #pragma warning ( disable: 4251 ) 50 void appendQuotedEscapedString(LogString& buf,
const LogString& input)
const;
51 void appendSerializedMDC(LogString& buf,
53 void appendSerializedNDC(LogString& buf,
55 void appendSerializedLocationInfo(LogString& buf,
60 BEGIN_LOG4CXX_CAST_MAP()
62 LOG4CXX_CAST_ENTRY_CHAIN(
Layout)
63 END_LOG4CXX_CAST_MAP()
76 this->locationInfo = locationInfoFlag;
97 this->prettyPrint = prettyPrintFlag;
114 return LOG4CXX_STR(
"application/json");
125 virtual void setOption(
const LogString& option,
const LogString& value);
127 virtual void format(LogString& output,
142 #if defined(_MSC_VER) 143 #pragma warning (pop) 146 #endif // _LOG4CXX_JSON_LAYOUT_H void setPrettyPrint(bool prettyPrintFlag)
The PrettyPrint option takes a boolean value.
Definition: jsonlayout.h:95
bool getLocationInfo() const
Returns the current value of the LocationInfo option.
Definition: jsonlayout.h:83
Extend this abstract class to create your own log layout format.
Definition: layout.h:38
bool getPrettyPrint() const
Returns the current value of the PrettyPrint option.
Definition: jsonlayout.h:103
virtual bool ignoresThrowable() const
The JSON layout handles the throwable contained in logging events.
Definition: jsonlayout.h:133
virtual void activateOptions(log4cxx::helpers::Pool &)
No options to activate.
Definition: jsonlayout.h:120
void setLocationInfo(bool locationInfoFlag)
The LocationInfo option takes a boolean value.
Definition: jsonlayout.h:74
Definition: appender.h:33
virtual LogString getContentType() const
Returns the content type output by this layout, i.e "application/json".
Definition: jsonlayout.h:112
This layout outputs events in a JSON dictionary.
Definition: jsonlayout.h:36