I have log4j2 configured using JSON format, e.g.:
{
"configuration": {
"monitorInterval": 60,
"properties": {
...
},
"appenders": {
...
},
"loggers": {
"asyncRoot": {
...
etc. The configuration is quite complex, so it requires some clarifications for whoever attempts to understand or change it in the future.
If this configuration was in XML, I could specify comments clarifying each section right in the configuration (changing my configuration to XML is not an option). But JSON doesn't have comments as a concept, and recommendation is to specify comments as data. E.g.:
{
"configuration": {
"monitorInterval": 60,
"_comment_": "here we go",
"properties": {
But I'm not sure if something like that is a good idea in log4j2 case: instead of making configuration more clear, it actually adds a bulk to it, such comments are not clearly separated from actual data, and I am not sure if it will cause any stability / performance issues parsing configuration (as you can see, this configuration is parsed every 60 sec, so...)
Is there any common / recommended approach to describe the configuration with log4j2? Or did you successfully test/use the above approach (comments as data)?
Thanks in advance.