CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Installing CiviCRM »
  • CiviMail installation and configuration (Moderator: Donald Lobo) »
  • Debug / Log CiviMail
Pages: [1]

Author Topic: Debug / Log CiviMail  (Read 7928 times)

yogibear

  • I post occasionally
  • **
  • Posts: 66
  • Karma: 0
    • Byron Yoga
  • CiviCRM version: 4.1
  • CMS version: 6.2
  • MySQL version: 5.0
  • PHP version: 5.2
Debug / Log CiviMail
September 30, 2009, 05:16:45 pm
Howdy, I have read a lot of posts here about debugging or logging CiviMail activity to pinpoint issues...

Despite that I am still unclear exactly how to view logs of CiviMail activity.

Could someone please enlighten me what to modify and then exactly where I can see the logged output.

I understand there are three places logging might be enabled:

1) civicrm.settings.php - add the following statement: define( 'CIVICRM_MAIL_LOG' , 1 );

2) /sites/all/modules/civicrm/packages/Mail - smtp.php
change "var $_debug = false;" to "var $_debug = true;"

3) /sites/all/modules/civicrm/packages/Net - SMTP.php
change "var $_debug = false;" to "var $_debug = true;"

Thanking somebody greatly :)

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Debug / Log CiviMail
September 30, 2009, 06:12:25 pm

1. if u enable the CIVICRM_MAIL_LOG setting, it does not contact the SMTP server. All mails are logged at files/civicrm/upload/mail under various cryptic md5 string file names

2. if the above is disabled, the effect of setting debug should be a lot of messages on your screen

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

yogibear

  • I post occasionally
  • **
  • Posts: 66
  • Karma: 0
    • Byron Yoga
  • CiviCRM version: 4.1
  • CMS version: 6.2
  • MySQL version: 5.0
  • PHP version: 5.2
Re: Debug / Log CiviMail
September 30, 2009, 06:28:19 pm
I changed "var $_debug = true;" in both files and did a test mailout, but no logging to screen.

Is that logging to screen supposed to happen immediately after I press "Submit Mailing"?

It would be handy if it logged to a file somewhere.

TIA.

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Debug / Log CiviMail
September 30, 2009, 06:52:35 pm

did u disable the mail log setting

for civimail cronjobs you'll see the output when running the cron script

you might want to file a feature request with the PEAR folks to enable logging to a file

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

davej

  • Ask me questions
  • ****
  • Posts: 404
  • Karma: 21
Re: Debug / Log CiviMail
April 21, 2010, 11:14:05 am
Quote from: Donald Lobo on September 30, 2009, 06:12:25 pm
1. if u enable the CIVICRM_MAIL_LOG setting, it does not contact the SMTP server. All mails are logged at files/civicrm/upload/mail under various cryptic md5 string file names

In Civi 3.1, mails are logged in files/civicrm/templates_c/en_US/ConfigAndLog/mail .

Beware: if Global Settings -> Outbound Email is set to sendmail rather than SMTP, it seems that CIVICRM_MAIL_LOG is ignored and mails are sent rather than logged.

Dave J

Piotr Szotkowski

  • I live on this forum
  • *****
  • Posts: 1497
  • Karma: 57
Re: Debug / Log CiviMail
May 03, 2010, 10:15:48 am
Quote from: davej on April 21, 2010, 11:14:05 am
Beware: if Global Settings -> Outbound Email is set to sendmail rather than SMTP, it seems that CIVICRM_MAIL_LOG is ignored and mails are sent rather than logged.

This was fixed on trunk in r26764 (and, I think, subsequently back-ported where appropriate).
If you found the above helpful, please consider helping us in return – you can even steer CiviCRM’s future and help us extend CiviCRM in ways useful to you.

xcf33

  • I post frequently
  • ***
  • Posts: 181
  • Karma: 7
  • CiviCRM version: 3.3.2
  • CMS version: Drupal 6.19/6.20
  • MySQL version: 5.x
  • PHP version: 5.2.6
Re: Debug / Log CiviMail
July 19, 2010, 11:59:43 am
I'm using the logging and everything looks fine,

However, the problem is that I'm doing testing with about 50,000 mailing sizes and I don't have shell access to go back and delete the mail log folder (Only have FTP access)

Where can I comment out the code that writes the email message to file so I can still observe the database changes but not see files being created?


Thanks.

davej

  • Ask me questions
  • ****
  • Posts: 404
  • Karma: 21
Re: Debug / Log CiviMail
July 23, 2010, 02:44:05 am
Quote from: xcf33 on July 19, 2010, 11:59:43 am
Where can I comment out the code that writes the email message to file so I can still observe the database changes but not see files being created?

According to http://wiki.civicrm.org/confluence/display/CRMDOC/Debugging:
Code: [Select]
define('CIVICRM_MAIL_LOG', 1); // writes emails to disk, never sends them. Write to civicrm/upload/mail directory by default
define('CIVICRM_MAIL_LOG', '/dev/null'); // emails are thrown away

Dave J

xcf33

  • I post frequently
  • ***
  • Posts: 181
  • Karma: 7
  • CiviCRM version: 3.3.2
  • CMS version: Drupal 6.19/6.20
  • MySQL version: 5.x
  • PHP version: 5.2.6
Re: Debug / Log CiviMail
July 23, 2010, 11:53:39 am
Thanks, I guess I wasn't looking, took 12 hours to delete around 200k emails being written to file :)

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Installing CiviCRM »
  • CiviMail installation and configuration (Moderator: Donald Lobo) »
  • Debug / Log CiviMail

This forum was archived on 2017-11-26.