Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Logs from load-balanced servers

Tags:

logging

log4j

Excuse me if this sounds like a basic question, but I'm new to web development.

We load balance across several servers. The apps are configured to log using log4j. They each write to log files on their respective servers. That means that researching issues means getting logs from all of these servers, which is tedious, and means going thru Ops as they control the load balancing, and introduces delays.

Is this the norm for web app logging? Or are there easy solutions to consolidating logging in one place? What are standard practices for making logs easily available to developers?

like image 764
Sumit Kishore Avatar asked Dec 16 '09 18:12

Sumit Kishore


People also ask

How do I check my load balancer traffic?

You can use the following features to monitor your load balancers, analyze traffic patterns, and troubleshoot issues with your load balancers and targets. You can use Amazon CloudWatch to retrieve statistics about data points for your load balancers and targets as an ordered set of time-series data, known as metrics.


2 Answers

Log to SQL using the JDBC appender (or an alternative version) instead of files.

like image 65
tvanfosson Avatar answered Sep 27 '22 23:09

tvanfosson


There is a wide variety of logging you can do, and which is available automatically.

Some types are:

  • Logging to built in machine logs, (Event logs or similiar.).
    For these, get access granted so you can access them remotely, and collate/examine as required.
  • Logging by applications which typically log to text files on the local machine. (IIS, or other.)
    Get access granted to the folders, so you can analyze these yourselves.
  • Custom logging.
    I recommend logging to a database. (Although these need to be pruned/summarized frequently.)
    If the logging to the database fails, logging to machine logs occurs.
    Note: This can have a performance impact, so be careful how much logging you do.

If operations is unwilling to give you direct access, see if a routinue dump of these files can be done to a location you can access.

like image 27
Bravax Avatar answered Sep 27 '22 21:09

Bravax