rschmitt opened a new issue, #212:
URL: https://github.com/apache/logging-log4j-transform/issues/212

   I noticed that transformation to `v2:json` produces a single-line JSON file 
with no pretty-printing, no indentation, and not even a trailing newline. None 
of the other supported output formats have this issue: XML, YAML, and 
`v3:properties` all look good to me.
   
   ```shell
   $ wget 
'https://repository.apache.org/content/groups/snapshots/org/apache/logging/log4j/log4j-transform-cli/0.3.0-SNAPSHOT/log4j-transform-cli-0.3.0-20250305.124252-9-shaded.jar'
   $ cat <<EOF >test.properties
   heredoc> log4j.rootLogger=ERROR, stdout
   
   log4j.appender.stdout=org.apache.log4j.ConsoleAppender
   log4j.appender.stdout.Target=System.out
   log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
   log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p 
%c{1}:%L - %m%n
   
   log4j.logger.org.apache.spark=ERROR
   EOF
   $ java -jar log4j-transform-cli-0.3.0-20250305.124252-9-shaded.jar 
config-file convert -i v1:properties -o v2:json test.properties test.json
   $ wc -l test.json
          0 test.json
   $ cat test.json
   
{"Configuration":{"Properties":{},"Appenders":{"Console":{"follow":"false","immediateFlush":"true","name":"stdout","target":"SYSTEM_OUT","PatternLayout":{"pattern":"%d{yyyy-MM-dd
 HH:mm:ss} %-5p %c{1}:%L - 
%m%n"}}},"Loggers":{"Root":{"level":"ERROR","AppenderRef":{"ref":"stdout"}},"Logger":{"level":"ERROR","name":"org.apache.spark"}}}}%
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to