Updated Chat Logger.

Following suggestions and examples:
* Chat logger methods are optimized.
* User can now turn chat logging on or off.
* Optimized sql related.
* New configuration file to turn Chat Logging or or off.