Welcome!

Blog Feed Post

Log Management for IBM Bluemix and Cloud Foundry

Enterprises without DevOps teams and culture typically experience long applications deployment cycles. Once developers make a new release the operations team needs to deploy it to one of the existing or new servers, and it often takes a long time (up to several weeks is not uncommon) to get a new application deployed to production. This process may include hardware purchases, configuration, and troubleshooting sessions with the development team. Especially the troubleshooting portion might take a while, with the typical e-mail ping-pong with commands for the administrators, sysadmins sending log files to the developers… Modern digital businesses don’t operate that way any more.  Instead, modern DevOps teams often utilize PaaS to boost productivity, without even thinking of server resources, ansible/chef/puppet scripts and related stuff. They push their application releases with a few commands to “the cloud” – typically a platform as a service (PaaS) like IBM Bluemix! Once deployments get simplified in such a way, the next logical step is to disrupt the e-mail ping-pong for troubleshooting by introducing centralized log management. Logs are the most important source of information for application troubleshooting. Central log management is crucial for providing real-time log access to relevant teammates.  

In this post, we’ll show how to do this by deploying a Node.js app to IBM Bluemix and using Logsene for Log Management.


Let’s start with the deployment of a Node.js app on IBM Bluemix. First, we’ll clone a git repository.

> git clone hello-world-app
> cd hello-world-app

Next, because IBM Bluemix is based on Cloud Foundry, we’ll use a few commands to get access to IBM Bluemix:

> cf api https://api.ng.bluemix.net> cf login

When prompted for username and password enter your IBM ID (email) and password. The final step is to push the app in the current directory to IBM Bluemix:

> cf push app1

This takes a while and the command prints the deployment status to the console. Once your app starts successfully, it will be available via the displayed URL (orgSpace-appName), e.g.

Showing health and status for app hello-world-seti123 in org ORG1 / space seti321 as [email protected]…
OK
requested state: started
instances: 1/1
usage: 1G x 1 instances
urls: hello-world-seti123.mybluemix.net
last uploaded: Tue Dec 13 16:02:11 UTC 2016
stack: cflinuxfs2
buildpack: SDK for Node.js(TM) (ibm-node.js-4.6.2, buildpack-v3.9-20161128-1327)
     state     since                    cpu    memory         disk           details
#0   running   2016-12-13 05:03:27 PM   0.0%   114.9M of 1G   117.8M of 1G

Access the app via curl or the browser and check the most recent application logs in the IBM Bluemix user interface.

image02https://i0.wp.com/sematext.com/wp-content/uploads/2017/01/image02.png?re... 300w, https://i0.wp.com/sematext.com/wp-content/uploads/2017/01/image02.png?re... 768w, https://i0.wp.com/sematext.com/wp-content/uploads/2017/01/image02.png?re... 1024w, https://i0.wp.com/sematext.com/wp-content/uploads/2017/01/image02.png?w=... 1296w" sizes="(max-width: 648px) 100vw, 648px" data-recalc-dims="1" />

While at first you may think Bluemix provides log management service and wonder why you’d need to ship your logs from Bluemix to a Log Management SaaS, you will quickly realize that IBM Bluemix shows only the most recent logs. That, of course, is a no-go for production, where we need logs for at least the last few days, several weeks, or even archived for a longer period.

The Cloud Foundry documentation shows the option to forward logs via so called log drains from any Cloud Foundry app to centralized Log Management tools like Logsene. Here you can choose the retention time, save search queries, define alerts on logs, or visualize them in Kibana! The setup for this is done with another small set of  Cloud Foundry commands:

  1. Create a Logsene Application to obtain the Logsene Application token
  2. Create the log drain to your Logsene App (note the Logsene token in the URL):
    cf cups logsene-log-drain -l https://logsene-cf-receiver.sematext.com/1a4a748f-33c3-4e73-9e25-f3f0c82ff0f2
  3. Bind the log drain to your app. You could optionally bind multiple apps to the same log drain:
    cf bind-service YOUR-APP-NAME logsene-log-drain
  4. Re-stage the app to pick up the newly bound service:
    cf restage YOUR-APP-NAME

A few seconds later your logs will start arriving to Logsene and you will be able to search and visualize them in Logsene’s built-in Kibana:image01https://i1.wp.com/sematext.com/wp-content/uploads/2017/01/image01.png?re... 300w, https://i1.wp.com/sematext.com/wp-content/uploads/2017/01/image01.png?re... 768w, https://i1.wp.com/sematext.com/wp-content/uploads/2017/01/image01.png?re... 1024w, https://i1.wp.com/sematext.com/wp-content/uploads/2017/01/image01.png?w=... 1296w" sizes="(max-width: 648px) 100vw, 648px" data-recalc-dims="1" />

IBM Bluemix logs in Kibana

image00https://i2.wp.com/sematext.com/wp-content/uploads/2017/01/image00.png?re... 300w, https://i2.wp.com/sematext.com/wp-content/uploads/2017/01/image00.png?re... 768w" sizes="(max-width: 648px) 100vw, 648px" data-recalc-dims="1" />

Alert definition for logs in Logsene

Your logs are safe for the configured retention time, and if you need to archive your logs to Amazon S3, Logsene can archive your logs to S3 for you, too. Just another little time safer for modern DevOps teams!

SIGN UP – FREE TRIAL

Read the original blog entry...

More Stories By Sematext Blog

Sematext is a globally distributed organization that builds innovative Cloud and On Premises solutions for performance monitoring, alerting and anomaly detection (SPM), log management and analytics (Logsene), and search analytics (SSA). We also provide Search and Big Data consulting services and offer 24/7 production support for Solr and Elasticsearch.

Latest Stories
In his session at 21st Cloud Expo, Raju Shreewastava, founder of Big Data Trunk, provided a fun and simple way to introduce Machine Leaning to anyone and everyone. He solved a machine learning problem and demonstrated an easy way to be able to do machine learning without even coding. Raju Shreewastava is the founder of Big Data Trunk (www.BigDataTrunk.com), a Big Data Training and consulting firm with offices in the United States. He previously led the data warehouse/business intelligence and B...
Blockchain is a shared, secure record of exchange that establishes trust, accountability and transparency across business networks. Supported by the Linux Foundation's open source, open-standards based Hyperledger Project, Blockchain has the potential to improve regulatory compliance, reduce cost as well as advance trade. Are you curious about how Blockchain is built for business? In her session at 21st Cloud Expo, René Bostic, Technical VP of the IBM Cloud Unit in North America, discussed the b...
The past few years have brought a sea change in the way applications are architected, developed, and consumed—increasing both the complexity of testing and the business impact of software failures. How can software testing professionals keep pace with modern application delivery, given the trends that impact both architectures (cloud, microservices, and APIs) and processes (DevOps, agile, and continuous delivery)? This is where continuous testing comes in. D
SYS-CON Events announced today that Synametrics Technologies will exhibit at SYS-CON's 22nd International Cloud Expo®, which will take place on June 5-7, 2018, at the Javits Center in New York, NY. Synametrics Technologies is a privately held company based in Plainsboro, New Jersey that has been providing solutions for the developer community since 1997. Based on the success of its initial product offerings such as WinSQL, Xeams, SynaMan and Syncrify, Synametrics continues to create and hone in...
With tough new regulations coming to Europe on data privacy in May 2018, Calligo will explain why in reality the effect is global and transforms how you consider critical data. EU GDPR fundamentally rewrites the rules for cloud, Big Data and IoT. In his session at 21st Cloud Expo, Adam Ryan, Vice President and General Manager EMEA at Calligo, examined the regulations and provided insight on how it affects technology, challenges the established rules and will usher in new levels of diligence arou...
Nordstrom is transforming the way that they do business and the cloud is the key to enabling speed and hyper personalized customer experiences. In his session at 21st Cloud Expo, Ken Schow, VP of Engineering at Nordstrom, discussed some of the key learnings and common pitfalls of large enterprises moving to the cloud. This includes strategies around choosing a cloud provider(s), architecture, and lessons learned. In addition, he covered some of the best practices for structured team migration an...
As you move to the cloud, your network should be efficient, secure, and easy to manage. An enterprise adopting a hybrid or public cloud needs systems and tools that provide: Agility: ability to deliver applications and services faster, even in complex hybrid environments Easier manageability: enable reliable connectivity with complete oversight as the data center network evolves Greater efficiency: eliminate wasted effort while reducing errors and optimize asset utilization Security: imple...
Mobile device usage has increased exponentially during the past several years, as consumers rely on handhelds for everything from news and weather to banking and purchases. What can we expect in the next few years? The way in which we interact with our devices will fundamentally change, as businesses leverage Artificial Intelligence. We already see this taking shape as businesses leverage AI for cost savings and customer responsiveness. This trend will continue, as AI is used for more sophistica...
No hype cycles or predictions of a gazillion things here. IoT is here. You get it. You know your business and have great ideas for a business transformation strategy. What comes next? Time to make it happen. In his session at @ThingsExpo, Jay Mason, an Associate Partner of Analytics, IoT & Cybersecurity at M&S Consulting, presented a step-by-step plan to develop your technology implementation strategy. He also discussed the evaluation of communication standards and IoT messaging protocols, data...
Companies are harnessing data in ways we once associated with science fiction. Analysts have access to a plethora of visualization and reporting tools, but considering the vast amount of data businesses collect and limitations of CPUs, end users are forced to design their structures and systems with limitations. Until now. As the cloud toolkit to analyze data has evolved, GPUs have stepped in to massively parallel SQL, visualization and machine learning.
The 22nd International Cloud Expo | 1st DXWorld Expo has announced that its Call for Papers is open. Cloud Expo | DXWorld Expo, to be held June 5-7, 2018, at the Javits Center in New York, NY, brings together Cloud Computing, Digital Transformation, Big Data, Internet of Things, DevOps, Machine Learning and WebRTC to one location. With cloud computing driving a higher percentage of enterprise IT budgets every year, it becomes increasingly important to plant your flag in this fast-expanding busin...
Modern software design has fundamentally changed how we manage applications, causing many to turn to containers as the new virtual machine for resource management. As container adoption grows beyond stateless applications to stateful workloads, the need for persistent storage is foundational - something customers routinely cite as a top pain point. In his session at @DevOpsSummit at 21st Cloud Expo, Bill Borsari, Head of Systems Engineering at Datera, explored how organizations can reap the bene...
In his Opening Keynote at 21st Cloud Expo, John Considine, General Manager of IBM Cloud Infrastructure, led attendees through the exciting evolution of the cloud. He looked at this major disruption from the perspective of technology, business models, and what this means for enterprises of all sizes. John Considine is General Manager of Cloud Infrastructure Services at IBM. In that role he is responsible for leading IBM’s public cloud infrastructure including strategy, development, and offering m...
Kubernetes is an open source system for automating deployment, scaling, and management of containerized applications. Kubernetes was originally built by Google, leveraging years of experience with managing container workloads, and is now a Cloud Native Compute Foundation (CNCF) project. Kubernetes has been widely adopted by the community, supported on all major public and private cloud providers, and is gaining rapid adoption in enterprises. However, Kubernetes may seem intimidating and complex ...
In his session at 21st Cloud Expo, Michael Burley, a Senior Business Development Executive in IT Services at NetApp, described how NetApp designed a three-year program of work to migrate 25PB of a major telco's enterprise data to a new STaaS platform, and then secured a long-term contract to manage and operate the platform. This significant program blended the best of NetApp’s solutions and services capabilities to enable this telco’s successful adoption of private cloud storage and launching ...