Added a configuration flag to enable/disable logging