Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Spring Boot and Angular

You're reading from   Spring Boot and Angular Hands-on full stack web development with Java, Spring, and Angular

Arrow left icon
Product type Paperback
Published in Dec 2022
Publisher Packt
ISBN-13 9781803243214
Length 438 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Authors (2):
Arrow left icon
Seiji Ralph Villafranca Seiji Ralph Villafranca
Author Profile Icon Seiji Ralph Villafranca
Seiji Ralph Villafranca
Devlin Basilan Duldulao Devlin Basilan Duldulao
Author Profile Icon Devlin Basilan Duldulao
Devlin Basilan Duldulao
Arrow right icon
View More author details
Toc

Table of Contents (24) Chapters Close

Preface 1. Part 1: Overview of Spring Boot and Angular Development
2. Chapter 1: Spring Boot and Angular – The Big Picture FREE CHAPTER 3. Chapter 2: Setting Up the Development Environment 4. Part 2: Backend Development
5. Chapter 3: Moving into Spring Boot 6. Chapter 4: Setting Up the Database and Spring Data JPA 7. Chapter 5: Building APIs with Spring 8. Chapter 6: Documenting APIs with the OpenAPI Specification 9. Chapter 7: Adding Spring Boot Security with JWT 10. Chapter 8: Logging Events in Spring Boot 11. Chapter 9: Writing Tests in Spring Boot 12. Part 3: Frontend Development
13. Chapter 10: Setting Up Our Angular Project and Architecture 14. Chapter 11: Building Reactive Forms 15. Chapter 12: Managing States with NgRx 16. Chapter 13: Saving, Deleting, and Updating with NgRx 17. Chapter 14: Adding Authentication in Angular 18. Chapter 15: Writing Tests in Angular 19. Part 4: Deployment
20. Chapter 16: Packaging Backend and Frontend with Maven 21. Chapter 17: Deploying Spring Boot and the Angular App 22. Index 23. Other Books You May Enjoy

Logging using Log4j2

Log4j2 is one of the most common logging frameworks used with Java. Since SLF4J is an abstraction of logging frameworks, Log4j2 can be used with SLF4J. Log4j2 is very flexible and offers different ways to store log information for debugging; it also supports asynchronous logging and displays logs with a severity level to quickly identify the importance of messages.

Let’s discuss the following features of Log4j2:

  • The Log4j2 Logger
  • Log4j2 Appenders
  • Log4j2 Layouts
  • Log4j2 Markers
  • Log4j2 Filters

The Log4j2 Logger

The Logger is the main feature used by our application to create LogRecord instances. This means the logger is responsible for dispatching the messages. To create a Log4j2 Logger, we only need the following code:

Logger log = LogManager.getLogger(ExampleClass.class);

After creating a new Logger, we can now use it to call several methods, such as info(), to dispatch messages.

Log4j2 Appenders

Appenders...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime