Logging doesn't seem to output to sugarcrm.log

We are using Sugar Community Edition version 6.2.

Only MysqlManager.php seems to print to sugarcrm.log:
$GLOBALS['log']->info('Query Execution Time:'.$this->query_time);

My own logs in logic hooks and other files, using the same above syntax, do not print anything to the logfile. No idea why.
 
Logging is turned on and set to "debug" in the admin panel, and config.php  has the right info:


  'log_dir' => '.',
  'log_file' => 'sugarcrm.log',
  'log_memory_usage' => false,
  'logger' =>
  array (
    'level' => 'info',
    'file' =>
    array (
      'ext' => '.log',
      'name' => 'sugarcrm',
      'dateFormat' => '%c',
      'maxSize' => '10MB',
      'maxLogs' => 10,
      'suffix' => '%m_%Y',
    ),
  ),



What could be wrong?
  • Verify the directory is writeable by the web server user.  In the case of apache, that is usually the user "nobody"
  • Thanks for the swift response.  The current directory of the logfile is sugar's root directory, which I'm pretty sure is the default--am I safe in changing the owner of this directory...? I could just change the log location, in the config file to something new, but I'm paranoid about that as well.
  • Yes, it should be safe to change the owner of this directory to the user that the web server runs as.

    On a unix system, provided the web server runs as the user "nobody"
    • chown nobody:nobody /path/to/sugar 
    • find /path/to/sugar -type d -exec chmod 2775 {} \;
    • find /path/to/sugar -type f -exec chmod 664 {} \;
    This should get you going.
  • All I had to do was chown the sugar dir to nobody:nogroup and the logs worked like a charm. Thanks Zac! Wasn't expecting a resolution this fast and simple :)