Bug #60930 Workbench creates wb.log in ~ instead of ~/.mysql/workbench
Submitted: 20 Apr 2011 7:32 Modified: 21 Jun 2011 18:12
Reporter: Daniël van Eeden Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench Severity:S3 (Non-critical)
Version:5.2.33 OS:Linux
Assigned to: CPU Architecture:Any

[20 Apr 2011 7:32] Daniël van Eeden
Description:
$ cat wb.log
09:23:49 [   Info][      wbprivate]: WbContext::init
09:23:50 [   Info][     grt.python]: Ready.
09:23:50 [   Info][     grt.python]: 

This files clutters my home directory and should be placed in ~/.mysql/workbench instead.

From backend/wbpublic/grt/grt_manager.cpp:
void GRTManager::set_use_log_file(bool value)
{
  if (value)
  {
    std::string log_filename;
    log_filename.append(get_tmp_dir()).append("wb.log");
    _log_file= base_fopen(log_filename.c_str(), "ab+");
  }
}

From library/base/log_impl.cpp:
base::Logger::Logger()
{
  if (!_impl)
    _impl = new base::Logger::LoggerImpl();

  // Currently we hardcode filename
  _impl->_filename = "wb.log";
  // truncate log file we do not need gigabytes of logs
  base::FILE_scope_ptr fp = fopen(_impl->_filename.c_str(), "w");
}

How to repeat:
Start workbench. and optionally configure/use a ssh tunnel.

Suggested fix:
move wb.log to ~/.mysql/workbench/
[26 May 2011 11:39] Daniël van Eeden
5.2.34 is logging to ~/.mysql/workbench/wb.log. Is this really fixed?
[21 Jun 2011 18:12] Paul DuBois
Noted in 5.2.34 changelogs.

Workbench now writes the wb.log file in the .mysql/workbench
directory rather than in ~ (the home directory).