Setup logging backends.
Always enables a colored console backend. If log_dir is given, also writes structured JSON to a file in that directory.
log_dir