Fix raw file logging, and add config option to default config