Building Reusable Angular Services: Logging

Learn how to perform logging in Angular applications by creating a set of reusable log publishing classes. A log publishers service replaces console.log() making your logging much more flexible.
Course info
Rating
(39)
Level
Intermediate
Updated
Oct 20, 2017
Duration
1h 51m
Table of contents
Course Overview
Building a Simple Logging Service
Adding Different Levels of Logging
Creating a Flexible Log Publishers Service
Building a Local Storage Publisher
Building a Web API Publisher
Reading Publishers from a JSON Configuration File
Description
Course info
Rating
(39)
Level
Intermediate
Updated
Oct 20, 2017
Duration
1h 51m
Description

Professional programmers know that logging errors and being able to track what is going on within an Angular application is essential. In this course, Building Reusable Angular Services: Logging, you'll learn how to design an Angular service to perform logging more efficiently and with more flexibility than just using console.log(), by creating an extensible Angular service to log any data to a variety of locations. First, you'll explore how to build a simple console logging class, a class to log to local storage, and a class to post log information to a Web API. Additionally, you'll delve into building different types of log entries, such as debug, informational, error, and warnings. Finally, you'll discover how to create a JSON configuration file to control where you log the data. By the end of this course, you'll have a great start on your logging service that can be used in your own applications. This service can replace all your console.log() calls to provide a better, and more flexible approach to logging.

About the author
About the author

Paul loves teaching and technology, and has been teaching tech and business topics for over 30 years. Paul helps clients develop applications, and instructs them on the best use of technology.

More from the author
JavaScript Syntax and Operators
Beginner
1h 42m
Nov 12, 2019
ADO.NET Fundamentals in C#
Intermediate
2h 29m
Sep 5, 2019
VB.NET Fundamentals
Beginner
3h 26m
May 21, 2019
More courses by Paul D. Sheriff
Section Introduction Transcripts
Section Introduction Transcripts

Course Overview
Hello everyone, my name is Paul Sheriff. Welcome to my course, Building Reusable Angular Services: Logging. This course is one in a series on how to create reusable components for your Angular applications. I am a Business Solutions Architect for Fairway Technologies, a premier provider of expert technology consulting and software development services. If you are still using console. log in Angular, you need to watch this course to see how to create a more flexible logging system for your applications. In this course, you replace console. log with a log publishing service that lets you log to the console, local storage, and to the Web API. By replacing each console. log statement with a call to the new log-publisher. ts, you give yourself much more flexibility. Throughout this course, you will do the following: create a log publishing service class, write different types of log entries, create a log publisher base class, learn to log to local storage, implement a Web API to accept log entries from Angular, and configure which publishers to call via a JSON configuration file. By the end of this course, you will have created a logging system that you can extend in any way you want. You still get the functionality of console. log, but the flexibility of an Angular service. Before watching this course, I am assuming you are familiar with Angular, JSON, the Web API, TypeScript, and HTML. I hope you'll join me on your mission to create a better logging system with my course entitled Building Reusable Angular Services: Logging, at Pluralsight. com.