1 First steps with Java logging

 

This chapter covers

  • Applying logging to your application
  • Understanding log messages
  • Introducing popular logging products

When computers had little CPU power and memory compared to today, we had two versions of software: the one that worked and the one that failed. If something broke, we could not see what went wrong. Fixing issues was expensive and time-consuming. The only silver lining? We got paid for the overtime.

At some point, programmers had the idea to let software write each step it took into a file. Now, we could see what was happening in real time. We could understand issues better and fix them sooner. Of course, no more overtime.

Today, developers optimize logging systems for speed, reliability, and flexibility. Now, we can write logs in production systems and monitor certain software behaviors. Logging systems have become a critical part of software development-but what is it?

1.1 What is logging?

Logging is the art of making hidden things visible. In a nutshell, we need logging to:

1.2 Who benefits from your log files?

1.3 The 6+2 questions to ask

1.4 How to log

1.4.1 Real-world logging

1.4.2 Logging frameworks

1.5 High-level architecture

1.6 What product do I need to log?

1.7 Summary