Tracking method calls and user actions – Logging
As a developer, you know how important it is to know what is happening in your application. Some information about the user clicks, event triggers, or error messages, having a good logging tool by your side telling you whether your application is okay (or really bad) is good practice. Commonly, developers use the common console.log()
statement and when it's time to deploy it to UAT or production, they comment all these lines.
Aurelia knows how important this feature is, and guess what—yes, it has its own plugin for this purpose. Let's explore!
Configuring your log manager
By default, Aurelia has the logging API already in their dependencies, so you don't need to run any npm
command at this point. Of course, if for some reason that library is missing, you know how to deal with it.
First, we need to create a file to configure our log levels. In the resources
folder, create a file called custom-log-appender.js
. This name is completely optional; you...