Log4J2 CloudWatch Appender - log4j

I'm looking for an official AWS CloudWatch Appender for Log4J2.
I've search all over and didn't find any.
Anybody there using CloudWatch in Java Apps with Log4J2?

I've been reading that the best approach to integrate with AWS Cloud Watch logs is using the Cloud Watch Log Agent.
It seems that having an independent agent will be much more reliable that the Application logging directly to Cloud Watch.
[Update] Why it may be more reliable?
If CloudWatch or the WebServer connection is down, the Appender may miss the Log Event. A write to disk would never be miss.
Nothing is faster than write to a stream file on local disk. When high log volume, sending data through a TCP connection could have performance impact or bottolnecks in the Application.

I would support the answer from Gonzalo.
I just want to update the answer with the new unified agent that can collect both logs and performances.
Collecting Metrics and Logs from Amazon EC2 Instances

Related

logstash vs a task queue for nodejs application

I have a nodejs web server where there seem to be a couple of bottlenecks preventing it from fully functioning peak load.
logging multiple events to our SQL server
logging multiple events to our elastic cluster
under heavy load , both SQL and elastic seem to reject my requests and/or considerably slow performance. So I've decided to reduce the load on these DBs via Logstash (for elastic) and an async task queue (for SQL)
Since i'm working on limited time , i'm wondering if i can solve these issues with just an async task queue (like kue) where i can push both SQL and elastic logs.
Do i need to implement logstash as well? or does an async queue solve the same thing as logstash.
You can try Async library's Queue feature and try and make it run on a child process or much better in a separate server as a Microservice for queues. That way you can move the load to another location, giving you a boost on your app server.
As you mentioned you are using azure I would strongly recommend using their queue solution plus a couple of azure functions to handle the read from the queue and processing.
I've rolled my own solution before using node.js and rabbitmq with node workers to read from the queue and write to elastic search because the solution couldn't go into the cloud.
It works and is robust but it takes quite a bit of configuration and custom code that is a maintenance nightmare. Ripped that out as soon as I could.
The benefits of using the azure service are:
Very little bespoke configuration is required.
Less custom code === less bugs & maintainence
scaling isn't an issue, some huge businesses rely on this
no 2am support calls, if azure is down they are going to fix it... fast
much cheaper, unless the throughput is massive and constant the scaling model is much cheaper and azure functions are perfect as you won't have running servers sitting there doing nothing when the queue is empty.
Same could be said for AWS and Google Cloud.

how to log Nodejs Debug Log into a single place in case of scalable architecture set up using Load Balancer

I have a NodeJs based scalable architecture, I want to log all the logs into single place. But in case load balancing, system logs will be scattered to multiple VMs.And I will loose the logs once VM scale down How to solve this issues?
How can I log all logs from all the scaled VMs in instance group into single place.
Here you go - use Stackdriver Logging, which is intended for this exact purpose! https://cloud.google.com/logging/docs/setup/nodejs

is there a recommended way of feeding logstash with azure operation logs?

I need to collect Azure operation logs to feed my ELK (elasticsearch, logstash and kibaba) cluster.
I'm looking for a ready-to-use solution. If none is available, I can write my own and in this case I'm looking for a design which is simple and reliable.
My current design is to have a worker role which uses Azure's REST API to fetch logs every minute or so and push log entries to my ELK cluster. Sounds like that will cost U$20/no and I'll have to design some bookkeeping for the periods which my worker role is interrupted.
With so many input options, my hope was that logstash had a plugin for this task.

Is Logstsh shipper instance and redis required in this architecture?

I have created a demo environment using Logstash, redis , elastic search and kibana. (http://indico.cern.ch/getFile.....
Here logstash shipper is reading logs from log file which i have centralized using syslog-ng. Loogstash shipper is forwarding it to redis then Logstash indexer (filter) and finally to Elasticsearch.
Now i want to skip logstash shipper and redis part from it. Is this a good idea? Or redis is mandatory Or require to deal with heavy load. I'm not sure about it.
In above pdf link i have read that Logstash has low buffering and redis manages flow of logs that why redis is used. As redis keeps data in memory what if memory gets full? Also read that Logstash and Elasticsearch can be quite hungry in terms of RAM usage. JVM options needs to be properly tuned. if so then, how to tune JVM?
Is it required to purge/rotate elasticsearch data/index?
So which one is best suited for heavy load? I want to parse logs like [ System (OS and daemons ) logs, syslog, web server logs (apache, lighttpd), application server logs (tomcat), database server logs (mysql) and some Application logs (through logfiles) ].
Give your suggestions for improvement. Thanks !!!.
Kindly find following link for IMAGE.
(http://a.disquscdn.com/uploads/mediaembed/images/709/3604/original.jpg)
In the set up you describe Redis should not be required, using syslog-ng to centralise the log files serves the same purpose as Redis when multiple shippers are used.
It might be necessary to prune elasticsearch indexes to reduce disk space requirements. This will depend on how quickly your elasticsearch data are growing, how much disk space you have available and how long you need the logs to be searchable for.
I can't advise on JVM tuning.

Need to check RDS diskspace utilization

Recently we have been facing problem on RDS as our allocated diskspace is getting exhausted on Amazon RDS.
So is there any tool/plugins (nagios plugin) available or any other utility through which we can monitor RDS Disk utilization?
P.S: We know cloudwatch can do this, but we are looking for other alternatives as well.
We use this check_cloudwatch plugin to grab any cloudwatch metric so it can graphed in our private cloud using PNP4Nagios and Graphite, works very well.
check_cloudwatch on github
I use aws cloud watch to monitor my rds instance's free space and cpu utilization. You can set up email alerts based on thresholds say when freespace < 25 GB. Like freespace there are variety of things you can monitor like R/W latency, DB connections, etc. You can find the steps (both via UI and cli) to setup cloud watch here.
aws cloud watch setup

Resources