How to implement the following event in Magento : As soon as the customer logs in the details are printed in the log file [duplicate]Magento 2: Get Customer data after login with observerMagento 2: Replacement for Mage::log method?Magento 2 is not generating the db_schema_whitelist.json file via CLImagento 2 how to print logMagento 2 : Create file type customer attributeUpdate custom data for customerHow to override the checkout_cart_configure.xml template file into custom module“PasswordHash” does not have accessor method “getPasswordHash” in class “MagentoCustomerApiDataCustomerInterface”How to debug checkout_cart_product_add_after event on exitMagento 2 Assign customer group name to externally calling JavaScript file variableMagento 2.3.1 : No such entity with customerId = Backend Login as Customer Logs pageMagento 2: Customer name not display in programmatically logged in user account

How to ask my manager for a part-time?

Idioms: Should it be " the internet is a seemingly infinite well of information" or "the internet is a seemingly infinite wealth of information"

Short story about a group of sci-fi writers sitting around discussing their profession

Why must API keys be kept private?

What is an Eternal Word™?

How may I shorten this shell script?

How could an engineer advance human civilization by time traveling to the past?

Why are there not any MRI machines available in Interstellar?

The seven story archetypes. Are they truly all of them?

Found more old paper shares from broken up companies

Can 々 stand for a duplicated kanji with a different reading?

Download file from URL to Safehouse

Why can't a country print its own money to spend it only abroad?

Travelling from Venice to Budapest, making a stop in Croatia

Using paddles to support a bug net

Sometimes you are this word with three vowels

Historicity doubted by Romans

Inverse Colombian Function

Is the Game Boy Sharp LR35902 object-compatible with the 8080/Z-80?

Why has DC been so Democratic compared to other states in the last presidential election?

Raw curve25519 public key points

Considerations when providing money to one child now, and the other later?

Where is this photo of a group of hikers taken? Is it really in the Ural?

Can I pay with HKD in Macau or Shenzhen?



How to implement the following event in Magento : As soon as the customer logs in the details are printed in the log file [duplicate]


Magento 2: Get Customer data after login with observerMagento 2: Replacement for Mage::log method?Magento 2 is not generating the db_schema_whitelist.json file via CLImagento 2 how to print logMagento 2 : Create file type customer attributeUpdate custom data for customerHow to override the checkout_cart_configure.xml template file into custom module“PasswordHash” does not have accessor method “getPasswordHash” in class “MagentoCustomerApiDataCustomerInterface”How to debug checkout_cart_product_add_after event on exitMagento 2 Assign customer group name to externally calling JavaScript file variableMagento 2.3.1 : No such entity with customerId = Backend Login as Customer Logs pageMagento 2: Customer name not display in programmatically logged in user account






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








1
















This question already has an answer here:



  • Magento 2: Get Customer data after login with observer

    3 answers



I have to print the login details of the customer and when he logged in, into the log file. How to implement the following problem in Magento 2.










share|improve this question













marked as duplicate by Prince Patel, Piyush, Manashvi Birla, Amit Bera Jul 15 at 12:23


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


















  • I need to print in customer log and not just fetch details

    – Naiwrita09
    Jul 15 at 5:48

















1
















This question already has an answer here:



  • Magento 2: Get Customer data after login with observer

    3 answers



I have to print the login details of the customer and when he logged in, into the log file. How to implement the following problem in Magento 2.










share|improve this question













marked as duplicate by Prince Patel, Piyush, Manashvi Birla, Amit Bera Jul 15 at 12:23


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


















  • I need to print in customer log and not just fetch details

    – Naiwrita09
    Jul 15 at 5:48













1












1








1









This question already has an answer here:



  • Magento 2: Get Customer data after login with observer

    3 answers



I have to print the login details of the customer and when he logged in, into the log file. How to implement the following problem in Magento 2.










share|improve this question















This question already has an answer here:



  • Magento 2: Get Customer data after login with observer

    3 answers



I have to print the login details of the customer and when he logged in, into the log file. How to implement the following problem in Magento 2.





This question already has an answer here:



  • Magento 2: Get Customer data after login with observer

    3 answers







magento2.3






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jul 15 at 5:15









Naiwrita09Naiwrita09

268 bronze badges




268 bronze badges




marked as duplicate by Prince Patel, Piyush, Manashvi Birla, Amit Bera Jul 15 at 12:23


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.









marked as duplicate by Prince Patel, Piyush, Manashvi Birla, Amit Bera Jul 15 at 12:23


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.














  • I need to print in customer log and not just fetch details

    – Naiwrita09
    Jul 15 at 5:48

















  • I need to print in customer log and not just fetch details

    – Naiwrita09
    Jul 15 at 5:48
















I need to print in customer log and not just fetch details

– Naiwrita09
Jul 15 at 5:48





I need to print in customer log and not just fetch details

– Naiwrita09
Jul 15 at 5:48










1 Answer
1






active

oldest

votes


















1














You can use event customer_login which will give you all customer data. Check here.



https://magento.stackexchange.com/a/178884/49826



For print in logs do as below.




Vendor/Module/etc/events.xml




<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
<event name="customer_login">
<observer name="customer_login_observer" instance="LazyCoderPaymentDeadlinesObserverCustomerLogin" />
</event>
</config>



Vendor/Module/Obsever/CustomerLogin.php




 <?php
namespace LazyCoderPaymentDeadlinesObserver;

use MagentoFrameworkEventObserverInterface;
use MagentoFrameworkEventObserver as EventObserver;

class CustomerLogin implements ObserverInterface

public function execute(EventObserver $observer)

$customer = $observer->getEvent()->getCustomer();
$name = $customer->getName(); //Get customer name


$writer = new ZendLogWriterStream(BP . '/var/log/logfile.log');
$logger = new ZendLogLogger();
$logger->addWriter($writer);
$logger->info($name); // Simple Text Log









share|improve this answer

























  • I have to use this within the execute function within the observer?

    – Naiwrita09
    Jul 15 at 5:21











  • can you provide me the controller file how to call this observer?

    – Naiwrita09
    Jul 15 at 5:33











  • No need for controller You only need to create observer and print data to log using above code.

    – Vivek
    Jul 15 at 5:48











  • My observer file:

    – Naiwrita09
    Jul 15 at 5:50






  • 1





    yes It worked thank you so much

    – Naiwrita09
    Jul 15 at 6:58



















1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









1














You can use event customer_login which will give you all customer data. Check here.



https://magento.stackexchange.com/a/178884/49826



For print in logs do as below.




Vendor/Module/etc/events.xml




<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
<event name="customer_login">
<observer name="customer_login_observer" instance="LazyCoderPaymentDeadlinesObserverCustomerLogin" />
</event>
</config>



Vendor/Module/Obsever/CustomerLogin.php




 <?php
namespace LazyCoderPaymentDeadlinesObserver;

use MagentoFrameworkEventObserverInterface;
use MagentoFrameworkEventObserver as EventObserver;

class CustomerLogin implements ObserverInterface

public function execute(EventObserver $observer)

$customer = $observer->getEvent()->getCustomer();
$name = $customer->getName(); //Get customer name


$writer = new ZendLogWriterStream(BP . '/var/log/logfile.log');
$logger = new ZendLogLogger();
$logger->addWriter($writer);
$logger->info($name); // Simple Text Log









share|improve this answer

























  • I have to use this within the execute function within the observer?

    – Naiwrita09
    Jul 15 at 5:21











  • can you provide me the controller file how to call this observer?

    – Naiwrita09
    Jul 15 at 5:33











  • No need for controller You only need to create observer and print data to log using above code.

    – Vivek
    Jul 15 at 5:48











  • My observer file:

    – Naiwrita09
    Jul 15 at 5:50






  • 1





    yes It worked thank you so much

    – Naiwrita09
    Jul 15 at 6:58















1














You can use event customer_login which will give you all customer data. Check here.



https://magento.stackexchange.com/a/178884/49826



For print in logs do as below.




Vendor/Module/etc/events.xml




<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
<event name="customer_login">
<observer name="customer_login_observer" instance="LazyCoderPaymentDeadlinesObserverCustomerLogin" />
</event>
</config>



Vendor/Module/Obsever/CustomerLogin.php




 <?php
namespace LazyCoderPaymentDeadlinesObserver;

use MagentoFrameworkEventObserverInterface;
use MagentoFrameworkEventObserver as EventObserver;

class CustomerLogin implements ObserverInterface

public function execute(EventObserver $observer)

$customer = $observer->getEvent()->getCustomer();
$name = $customer->getName(); //Get customer name


$writer = new ZendLogWriterStream(BP . '/var/log/logfile.log');
$logger = new ZendLogLogger();
$logger->addWriter($writer);
$logger->info($name); // Simple Text Log









share|improve this answer

























  • I have to use this within the execute function within the observer?

    – Naiwrita09
    Jul 15 at 5:21











  • can you provide me the controller file how to call this observer?

    – Naiwrita09
    Jul 15 at 5:33











  • No need for controller You only need to create observer and print data to log using above code.

    – Vivek
    Jul 15 at 5:48











  • My observer file:

    – Naiwrita09
    Jul 15 at 5:50






  • 1





    yes It worked thank you so much

    – Naiwrita09
    Jul 15 at 6:58













1












1








1







You can use event customer_login which will give you all customer data. Check here.



https://magento.stackexchange.com/a/178884/49826



For print in logs do as below.




Vendor/Module/etc/events.xml




<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
<event name="customer_login">
<observer name="customer_login_observer" instance="LazyCoderPaymentDeadlinesObserverCustomerLogin" />
</event>
</config>



Vendor/Module/Obsever/CustomerLogin.php




 <?php
namespace LazyCoderPaymentDeadlinesObserver;

use MagentoFrameworkEventObserverInterface;
use MagentoFrameworkEventObserver as EventObserver;

class CustomerLogin implements ObserverInterface

public function execute(EventObserver $observer)

$customer = $observer->getEvent()->getCustomer();
$name = $customer->getName(); //Get customer name


$writer = new ZendLogWriterStream(BP . '/var/log/logfile.log');
$logger = new ZendLogLogger();
$logger->addWriter($writer);
$logger->info($name); // Simple Text Log









share|improve this answer















You can use event customer_login which will give you all customer data. Check here.



https://magento.stackexchange.com/a/178884/49826



For print in logs do as below.




Vendor/Module/etc/events.xml




<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
<event name="customer_login">
<observer name="customer_login_observer" instance="LazyCoderPaymentDeadlinesObserverCustomerLogin" />
</event>
</config>



Vendor/Module/Obsever/CustomerLogin.php




 <?php
namespace LazyCoderPaymentDeadlinesObserver;

use MagentoFrameworkEventObserverInterface;
use MagentoFrameworkEventObserver as EventObserver;

class CustomerLogin implements ObserverInterface

public function execute(EventObserver $observer)

$customer = $observer->getEvent()->getCustomer();
$name = $customer->getName(); //Get customer name


$writer = new ZendLogWriterStream(BP . '/var/log/logfile.log');
$logger = new ZendLogLogger();
$logger->addWriter($writer);
$logger->info($name); // Simple Text Log










share|improve this answer














share|improve this answer



share|improve this answer








edited Jul 15 at 6:33

























answered Jul 15 at 5:17









VivekVivek

2,0281 gold badge9 silver badges38 bronze badges




2,0281 gold badge9 silver badges38 bronze badges












  • I have to use this within the execute function within the observer?

    – Naiwrita09
    Jul 15 at 5:21











  • can you provide me the controller file how to call this observer?

    – Naiwrita09
    Jul 15 at 5:33











  • No need for controller You only need to create observer and print data to log using above code.

    – Vivek
    Jul 15 at 5:48











  • My observer file:

    – Naiwrita09
    Jul 15 at 5:50






  • 1





    yes It worked thank you so much

    – Naiwrita09
    Jul 15 at 6:58

















  • I have to use this within the execute function within the observer?

    – Naiwrita09
    Jul 15 at 5:21











  • can you provide me the controller file how to call this observer?

    – Naiwrita09
    Jul 15 at 5:33











  • No need for controller You only need to create observer and print data to log using above code.

    – Vivek
    Jul 15 at 5:48











  • My observer file:

    – Naiwrita09
    Jul 15 at 5:50






  • 1





    yes It worked thank you so much

    – Naiwrita09
    Jul 15 at 6:58
















I have to use this within the execute function within the observer?

– Naiwrita09
Jul 15 at 5:21





I have to use this within the execute function within the observer?

– Naiwrita09
Jul 15 at 5:21













can you provide me the controller file how to call this observer?

– Naiwrita09
Jul 15 at 5:33





can you provide me the controller file how to call this observer?

– Naiwrita09
Jul 15 at 5:33













No need for controller You only need to create observer and print data to log using above code.

– Vivek
Jul 15 at 5:48





No need for controller You only need to create observer and print data to log using above code.

– Vivek
Jul 15 at 5:48













My observer file:

– Naiwrita09
Jul 15 at 5:50





My observer file:

– Naiwrita09
Jul 15 at 5:50




1




1





yes It worked thank you so much

– Naiwrita09
Jul 15 at 6:58





yes It worked thank you so much

– Naiwrita09
Jul 15 at 6:58



Popular posts from this blog

Grendel Contents Story Scholarship Depictions Notes References Navigation menu10.1093/notesj/gjn112Berserkeree

Area configuration aggregation error after install Porto themeMagento 2.1 CE Installed but front/backend not loading/workingCSS not loading on page within Magento 2 pageCannot install module in Magento 2no commands defined in the “setup” namespace. in Magento2Magento 2: Static files are present but shows 404Why do i have to always run the commands to clean cache in Magento 2.1.8?Failure reason: 'Unable to unserialize value.'Error 500 after magento migrationIn production mode the site does not loadMagento 2 : Error 500 after installing

Middle Expansion Olielle Resaix Definition: Uttering songs of triumph shouting with joy triumphant exulting Sejunction Journal 붙다 달 고급 품목 외출 The stretch trades the screeching tin. Definition: The act of speaking with a drawl a drawl Cough Sand Definition: An uproar a quarrel a noisy outbreak Shake Iron Publicize Horse House Baby 사과 Resaix Flaggy Jelly Temporary Unequaled Puppet A drop in the bucket Shrew 성격 회원 성질 미팅 The burn frames the tacky quality. Materialistic The smoke reduces the way. Yammoe Nondescript Cheek 얼굴 배 약하다 날리다 타다 The illegal country shows the iron. Help Rule Drearien Smoke Teaching Meaty Wasp Abraham Lincoln Jaws 진심 수리하다 Size Cork Idea Convert Think Lark John Lennon 거울 청소 군 추천하다 아이스크림