Add JSON logging format support with environment variable control (#2120)