Home » Tag Archives: Logging

Tag Archives: Logging

The 5 Java logging rules

java-logo

Logging is a critical factor that should be always kept into account during the software development. When something bad happens in production, the log files are usually the starting point of our fault analysis. And, often, they are the only information in our hands to understand what is happened and which is the root cause of the problem. It is ...

Read More »

Tutorial: logging during tests

slf4j-logo

Logging is a popular solution to show what the software is doing while it is running. But what happens to the logging when we are unit testing our application with jUnit/TestNG ? During the automated tests execution, we are usually not interested to see the logging messages because our main interest is the test results. It would be nice to ...

Read More »

Simplify your logging with tinylog 1.0

apache-log4j-logo

With a size of only 75 KB, tinylog is a lightweight alternative to the widespread classical logging frameworks Log4j and Logback. The final version 1.0 has been just released at the end of March, after three years of development. In several design issues, tinylog takes a deliberately different approach from classical logging frameworks in Java. This article will show the ...

Read More »

OptaPlanner – How fast is logging?

software-development-2-logo

What’s the cost of trace/debug logging in production? What’s the performance cost of logging to a file? In these benchmarks, I compare the performance impact of logging levels (error, warn, info, debug, trace) and logging appenders (console appender, file appender) on several realistic OptaPlanner use cases. Benchmark methodology Logging implementation: SFL4J 1.7.2 with Logback 1.0.9 (Logback is the spiritual successor ...

Read More »

Using Java 8 to Prevent Excessively Wide Logs

java-logo

Some logs are there to be consumed by machines and kept forever. Other logs are there just to debug and to be consumed by humans. In the latter case, you often want to make sure that you don’t produce too much logs, especially not too wide logs, as many editors and other tools have problems once line lenghts exceed a ...

Read More »

Writing your own logging service?

software-development-2-logo

Application logging is one those things like favorite Editors war: everyone has their own opinions and there are endless of implemenations and flavors out there. Now a days, you likely would want to use something already available such as Log4j or Logback. Even JDK has a built in “java.util.logging” implementation. To avoid couple to a direct logger, many projects would ...

Read More »

Java Method Logging with AOP and Annotations

java-interview-questions-answers

Sometimes, I want to log (through slf4j and log4j) every execution of a method, seeing what arguments it receives, what it returns and how much time every execution takes. This is how I’m doing it, with help of AspectJ, jcabi-aspects and Java 6 annotations:                 public class Foo { @Loggable public int power(int ...

Read More »

How to Instantly Improve Your Java Logging With 7 Logback Tweaks

logback-logo

The benchmark tests to help you discover how Logback performs under pressure Logging is essential for server-side applications but it comes at a cost. It’s surprising to see though how much impact small changes and configuration tweaks can have on an app’s logging throughput. In this post we will benchmark Logback’s performance in terms of log entries per minute. We’ll ...

Read More »

Locking and Logging

software-development-2-logo

Plumbr has been known as the tool to tackle memory leaks. As little as two months ago we released GC optimization features. But we have not been sitting idle after this – for months we have been working on lock contention detection. From the test runs we have discovered many awkward concurrency issues in hundreds of different applications. Many of ...

Read More »

Want to take your Java skills to the next level?

Grab our programming books for FREE!

Here are some of the eBooks you will get:

  • Advanced Java Guide
  • Java Design Patterns
  • JMeter Tutorial
  • Java 8 Features Tutorial
  • JUnit Tutorial
  • JSF Programming Cookbook
  • Java Concurrency Essentials