Fixing some Linux compatibility issues and adding support for JSON logging target.