[Skip to main content](#vessel-content)

#   Payment plugin write to log is not working

##

- **[Markus Schnier](/forum/user/44597-markus-schnier "View Markus Schnier's Profile")**
- [![Markus Schnier's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/44597-markus-schnier "View Markus Schnier's Profile") Topic Author
- [ Offline](/forum/user/44597-markus-schnier)

Less More

- Posts: 98
- Thank you received: 7
-
-

3 years 2 months ago [\#354483](#354483) by [Markus Schnier](/forum/user/44597-markus-schnier "View Markus Schnier's Profile")  *[Payment plugin write to log is not working](/forum/31-development/906894-payment-plugin-write-to-log-is-not-working#354483 "-- HikaShop version -- : 4.7.5 -- Joomla version -- : latest 4 -- PHP version -- : 8.1  Hi  I developed a payment plugin for payever based on your example. Since moving to J4 the Payment Log will not updated anymore based on your example  I checked the paypal plugins and saw that you worked now with  but just this statement in my plugin is not working. hikashop&#95;writeToLog(&quot;test&quot;);  Anything additonally needed to instantiate this function ? Thanks and best regards Markus")* was created by *[Markus Schnier](/forum/user/44597-markus-schnier "View Markus Schnier's Profile")*

-- HikaShop version -- : 4.7.5
-- Joomla version -- : latest 4
-- PHP version -- : 8.1

Hi

I developed a payment plugin for payever based on your example. Since moving to J4 the Payment Log will not updated anymore based on your example Code:

if($this-&gt;payment_params-&gt;debug) //Debug mode activated or not { //Here we display debug information which will be catched by HikaShop and stored in the payment log file available in the configuration's Files section. echo print_r($vars,true)."\n\n\n"; echo print_r($dbOrder,true)."\n\n\n"; echo print_r($hash,true)."\n\n\n"; }

I checked the paypal plugins and saw that you worked now with Code:

hikashop_writeToLog('paypal_id missing !');

but just this statement in my plugin is not working.
hikashop_writeToLog("test");

Anything additonally needed to instantiate this function ?
Thanks and best regards
Markus

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2RldmVsb3BtZW50LzkwNjg5NC1wYXltZW50LXBsdWdpbi13cml0ZS10by1sb2ctaXMtbm90LXdvcmtpbmc/dG1wbD1tYXJrZG93bg==) or [Create an account](/register) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86322
- Thank you received: 14280
-
-

3 years 2 months ago [\#354489](#354489) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Payment plugin write to log is not working](/forum/31-development/906894-payment-plugin-write-to-log-is-not-working#354489 "-- HikaShop version -- : 4.7.5 -- Joomla version -- : latest 4 -- PHP version -- : 8.1  Hi  I developed a payment plugin for payever based on your example. Since moving to J4 the Payment Log will not updated anymore based on your example  I checked the paypal plugins and saw that you worked now with  but just this statement in my plugin is not working. hikashop&#95;writeToLog(&quot;test&quot;);  Anything additonally needed to instantiate this function ? Thanks and best regards Markus")*

Hi,

print_r will still work fine. However, the problem with that is that the process needs to go successfully to the end so that the data displayed in the output is stored in the log by HikaShop. If you have something like this: Code:

echo print_r($vars,true); call_function_which_does_not_exists(); return;

you won't get anything in the payment log file, because PHP will generate a fatal error when trying to call call_function_which_does_not_exists, before HikaShop can log the output.

That's why we now usually use hikashop_writeToLog. This function will directly log the data provided, without waiting for anything.
If you have the line hikashop_writeToLog('test'); somewhere and you don't see anything in the payment log file, it means that your code is not being processed. The most probable is that the notification URL is not being called by the payment gateway for some reason.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2RldmVsb3BtZW50LzkwNjg5NC1wYXltZW50LXBsdWdpbi13cml0ZS10by1sb2ctaXMtbm90LXdvcmtpbmc/dG1wbD1tYXJrZG93bg==) or [Create an account](/register) to join the conversation.

- **[Markus Schnier](/forum/user/44597-markus-schnier "View Markus Schnier's Profile")**
- [![Markus Schnier's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/44597-markus-schnier "View Markus Schnier's Profile") Topic Author
- [ Offline](/forum/user/44597-markus-schnier)

Less More

- Posts: 98
- Thank you received: 7
-
-

3 years 2 months ago [\#354609](#354609) by [Markus Schnier](/forum/user/44597-markus-schnier "View Markus Schnier's Profile")  Replied by *[Markus Schnier](/forum/user/44597-markus-schnier "View Markus Schnier's Profile")* on topic *[Payment plugin write to log is not working](/forum/31-development/906894-payment-plugin-write-to-log-is-not-working#354609 "-- HikaShop version -- : 4.7.5 -- Joomla version -- : latest 4 -- PHP version -- : 8.1  Hi  I developed a payment plugin for payever based on your example. Since moving to J4 the Payment Log will not updated anymore based on your example  I checked the paypal plugins and saw that you worked now with  but just this statement in my plugin is not working. hikashop&#95;writeToLog(&quot;test&quot;);  Anything additonally needed to instantiate this function ? Thanks and best regards Markus")*

Hi Nicolas,

thanks. Let me test it with hikashop_writeToLog('test'); . A first test in the beginning of onPaymentNotification(&amp;$statuses) worked. Thanks for your help

Related question. To activate the php log my hosting provider requires that I put the php.ini into the related folders. But neither in the Plugins folders nor in the hikahsop folders this triggered a proper logging. The php-logs remains empty. Any idea ?

thanks and best regards
Markus

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2RldmVsb3BtZW50LzkwNjg5NC1wYXltZW50LXBsdWdpbi13cml0ZS10by1sb2ctaXMtbm90LXdvcmtpbmc/dG1wbD1tYXJrZG93bg==) or [Create an account](/register) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86322
- Thank you received: 14280
-
-

3 years 2 months ago [\#354612](#354612) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Payment plugin write to log is not working](/forum/31-development/906894-payment-plugin-write-to-log-is-not-working#354612 "-- HikaShop version -- : 4.7.5 -- Joomla version -- : latest 4 -- PHP version -- : 8.1  Hi  I developed a payment plugin for payever based on your example. Since moving to J4 the Payment Log will not updated anymore based on your example  I checked the paypal plugins and saw that you worked now with  but just this statement in my plugin is not working. hikashop&#95;writeToLog(&quot;test&quot;);  Anything additonally needed to instantiate this function ? Thanks and best regards Markus")*

Hi,

I'm not sure. What does "related folders" means for your hosting ?
If it's "the folder where the main PHP file being called is located", then you should put the php.ini file at the root of the website since the main PHP file being called is the index.php of Joomla for the frontend.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2RldmVsb3BtZW50LzkwNjg5NC1wYXltZW50LXBsdWdpbi13cml0ZS10by1sb2ctaXMtbm90LXdvcmtpbmc/dG1wbD1tYXJrZG93bg==) or [Create an account](/register) to join the conversation.

- **[Markus Schnier](/forum/user/44597-markus-schnier "View Markus Schnier's Profile")**
- [![Markus Schnier's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/44597-markus-schnier "View Markus Schnier's Profile") Topic Author
- [ Offline](/forum/user/44597-markus-schnier)

Less More

- Posts: 98
- Thank you received: 7
-
-

3 years 2 months ago [\#354722](#354722) by [Markus Schnier](/forum/user/44597-markus-schnier "View Markus Schnier's Profile")  Replied by *[Markus Schnier](/forum/user/44597-markus-schnier "View Markus Schnier's Profile")* on topic *[Payment plugin write to log is not working](/forum/31-development/906894-payment-plugin-write-to-log-is-not-working#354722 "-- HikaShop version -- : 4.7.5 -- Joomla version -- : latest 4 -- PHP version -- : 8.1  Hi  I developed a payment plugin for payever based on your example. Since moving to J4 the Payment Log will not updated anymore based on your example  I checked the paypal plugins and saw that you worked now with  but just this statement in my plugin is not working. hikashop&#95;writeToLog(&quot;test&quot;);  Anything additonally needed to instantiate this function ? Thanks and best regards Markus")*

Hi Nicolas,

that worked. I tried the Plugins and also the error is fixed.

Thanks and best regards
Markus

The following user(s) said Thank You: [nicolas](/forum/user/63-nicolas "View nicolas's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2RldmVsb3BtZW50LzkwNjg5NC1wYXltZW50LXBsdWdpbi13cml0ZS10by1sb2ctaXMtbm90LXdvcmtpbmc/dG1wbD1tYXJrZG93bg==) or [Create an account](/register) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.048 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
