Home » Tag Archives: Logging

Tag Archives: Logging

Spring Boot – Configure Log Level in runtime using actuator endpoint

spring-interview-questions-answers

As of Spring Boot 1.5 a new loggers actuator endpoint allows viewing and changing application logging levels in runtime. Add spring-boot-actuator to your project <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId> </dependency> Disable security for loggers or for all endpoints Set either management.security.enabled to false or endpoints.loggers.sensitive to false to disable security. Note that the latter changes only loggers endpoint. Get all loggers details ...

Read More »

Keeping Your Logs From Becoming an Unreadable Mess

When you run into a strange, seemingly unsolvable bug, improving your logging can be the best step you can take. Great logging is the easiest way to detect and fix entire classes of bugs. When you log enough information, you can see how your data changes during a request. You can track the calls you make to other services, and ...

Read More »

Java 8 Deferred Invocation with Java Util Logging

In the blog post Better Performing Non-Logging Logger Calls in Log4j2, I looked at approaches one can use in Log4j 2 to reduce or avoid invocation of methods in log statements that, based on the specified log level, are not actually logged at all. As part of this discussion, I covered Log4j 2‘s support for Java 8-based deferred execution using ...

Read More »

The 5 Java logging rules

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

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

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?

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 »

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:

  • Spring Interview QnA
  • Multithreading & Concurrency QnA
  • JPA Minibook
  • JVM Troubleshooting Guide
  • Advanced Java
  • Java Interview QnA
  • Java Design Patterns