Toggle logging level based on environment variable