By newray
•
January 31, 2023
Introduction The main goal of this blog post is to provide necessary information to get started on using Cloud Foundry Logging Component. A little introduction to concepts like Cloud-Native Apps, 12 Factor Apps is needed to understand System and Application logging on Cloud. Here is the breakdown of this blog post. The purpose of aggregating logs from all running instances of an application on cloud. How the aggregation of logs is handled on Open-Source PaaS - Cloud Foundry. How easy it is to route the log streams to a specialized log management system - Papertrail. Prerequisite This article assumes you are familiar with Cloud foundry A brief understanding of Cloud Native Applications. A high-level understanding of 12 Factor Apps concepts. I have provided links to various resources at the end of this article to get an understanding of these concepts before you go on and read this blog post. Why do we need to aggregate logs? Cloud Native Apps Applications designed and developed to take advantage of cloud features are supposed to be called cloud native apps. Following constraints makes cloud native applications difficult to troubleshoot. Distributed applications like microservices hard to maintain, and debug. Applications on cloud run on Virtual machines and(or) Containers which are ephemeral. Container Instances are immutable. Because of these constraints storing, analyzing application and system log information is difficult. 12 factor Apps 12 factor apps is like a benchmarking to make sure your application is built for cloud (like microservices) and following certain recommendations. Among the 12 factors following four factors are pertinent to topic of this post. Processes - 12 factor apps are supposed to be state-less so that scaling is easy. Concurrency - For high availability multiple instances of an App are run and load is distributed across. Disposability - To scale-out and scale-in, Apps should be quick to boot-up and easy to be disposable. Logs - 12 factor apps recommends treating logs from all app instances as event streams, never store them inside containers or virtual machines. Logs should be streamed out and stored somewhere else and should be aggregated not to loose them. What component of Cloud Foundry handles logging? Cloud Foundry Loggregator Component A brief introduction to Cloud foundry Cloud Foundry is an open-source Platform-As-A-Service (Paas) to run applications on any cloud. Instead of focusing on Cloud infrastructure CF abstracts all the operational activities and provides a platform to speedup application development and deployment. Various components of CF address certain factors of 12 factor operations. Loggregator component of CF takes care of aggregation of logs from all running instances of an application. Following diagram explains various sub components within PCF Loggragator Component.