Jump to content

debugging ./ logging


GreatSamps

Recommended Posts

Hi,

 

are there any functions for writing to log files. i am in the process of writing a gateway module, and without being able to write anything to a file i have no idea where or why its not working.

 

i tried using standard php fopen / fwrite, but that does nothing ... any ideas?

Link to comment
Share on other sites

Why not log your message to the Admin Log in WHMCS?

 

This is a WHMCS function that will do just that.

logactivity('This will go in the Admin Log!');

 

Interesting so if I want to output errors from my script to this?

 

echo 'Error message to show here';
logactivity('error message for admin log');

Link to comment
Share on other sites

Interesting so if I want to output errors from my script to this?

 

echo 'Error message to show here';
logactivity('error message for admin log');

 

Yes, it is what shows up on the main page of your admin area. I wouldn't log everything, but for modules and stuff like that it is perfect. I've used it for my Testimonials addon and WHMCSPM2. When a user submits a testimonial or uploads a file to WHMCSPM2, it is logged in the admin log. I also log license checking errors for licensed modules and addons.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated