How to debug a common server-side Java application

Here is my problem: I am trying to debug Apache Cassandra and understand the flow of the application. That is, when the request is sent by the client, say put (), which methods are called and how the system works internally.

So here is what I think:

  • Write the main method in cassandra code that calls put () entry point, sets breakpoints in eclipse, etc. etc. OR
  • Do not write the main method, just use a regular client (which accesses the server via TCP) and "debug" (by reading the log files and understanding the code) using log4j loggers (already implemented in cassandra).

So my question is: what is the ideal way to debug such a distributed application?

+4
source share
4 answers

The perfect way? Both.

You mentioned goals: “debug” and “understand the flow of the application” - it is very difficult to debug before understanding the flow, but understanding can be an end in itself.

In the real world, when working with large distributed systems, it often cannot rely on debuggers, at least initially, not least because some problems appear only when the system is busy or after several hours of operation. Therefore, good debugging tracing and fine-grained control over this tracing in application code and infrastructure code are important.

However, if you have the ability to run a debugger that can be sufficiently lit.

First of all, I think you need:

). , .

). IDE, . . . , , , ? , ? ?

followng , , .

+3

log4j MDC, put(), put()? , , , , , put(). - , , , .

: :

, 1. 2. , .

, , .

0

, . - ​​. , log4j ( ) , , . , - , . , ( ) , . MDC, . , . Log4j, , , (IMHO) .

0
source

Use logs, increase log levels if necessary, add additional log reports. on different components of a distributed system, profile different components, such as a database, application server, analyze the stack trace, use debugging tools in the built-in browser browser, if the web application and also focus control points

0
source

All Articles