Logging in SharePoint Framework Solutions
Hi Friends, today I will be discussing about how logging should be done in SharePoint Framework of SPFx solutions. Logging plays a very important role when we need to debug the code in the production for any error and improper or no logging makes it really hard to find the root cause of the issue. While logging we need to take care of the following pointers What information needs to be logged Where to log How long it should be maintained etc... To take on this burden, Microsoft has given a dedicated class for the logging which can be utilized well to make the purpose. @microsoft/sp-core-library This library holds the solution. In sp-core-library Microsoft has exported a class name " LOG " which contains the static methods to write the logs Below the how you can import the class into your solution import { Log } from ' @microsoft/sp-core-library ' ; In this class, you'll get 4 static methods Error Verbose Info Warn Let's have a look on how to use each of the me