Log4j 2 is a completely new log system built on Apache Log4j by referencing the logback architecture. Log4j 2 provides support for the Log4j 1.2, SLF4J, Commons Logging and java.util.logging (JUL) APIs. It also supports Java 8 Lambda.
The design ideas of Log4j 2 are inspiring - developing components into plug-ins improves the flexibility. With the rapid development of Internet technologies, various middleware products have been springing up. We need to think more about the relationship between one code and another. Undoubtedly, the decoupled relationship is the most beautiful one.
The LogManager is a critical component. We can see the LogManager which initializes the corresponding LoggerContext is based on the specified LogContextFactory.
LoggerContext is as the following:
1. Parses the configuration file to obtain the corresponding Java object 2. Cache log configuration through LoggerRegisty 3. Obtain the configuration information 4. Use the start() method to parse the configuration file, and convert the configuration file into the corresponding Java object 5. Obtain the logger object through getLogger
For details about Log4j 2 on startup, configuration, asynchronization, and plug-in-based components, you can go to Exploring the Secrets of Java Logs: Log4j 2 Log System.
Alibaba Cloud's Function Compute service has a range of applications on offer, including API gateways, data lake analysis, log stores and backups, web crawlers and image recognition, to name just a few. With Function Compute, developing is convenient and reliable. Function Compute supports many different programming languages including Java, Python, PHP, and NodeJS.
In this tutorial, we will show you how to create an Alibaba Cloud Log Service project which triggers an Alibaba Cloud Function Compute function.
Logs are ubiquitous. As a carrier that records changes in the world, logs are widely used in many fields, such as marketing, research and development, operation, security, BI, and auditing.
This article introduces Alibaba Cloud's LOG Java Producer, an easy-to-use, highly configurable Java library that helps you send data to Log Service.
The consumer library is an advanced mode of log consumption in Log Service, and provides the consumer group concept to abstract and manage the consumption end. Compared with using SDKs directly to read data, you can only focus on the business logic by using the consumer library, without caring about the implementation details of Log Service, or the load balancing or failover between consumers.
In recent years, the advent of stateless programming, containers, and serverless programming greatly increased the efficiency of software delivery and deployment.
Alibaba Cloud Community - November 9, 2021
Alibaba Clouder - May 17, 2019
Alibaba Cloud Storage - June 19, 2019
Alibaba Cloud Native Community - October 10, 2022
Dikky Ryan Pratama - May 9, 2023
Alibaba Cloud Serverless - February 28, 2023
More Posts by Alibaba Clouder