Home » Tag Archives: Logging (page 2)

Tag Archives: Logging

5 techniques to improve your server logging

java-duke-logo

In the recent time we’ve seen a plethora of tools that help you make sense of your logs. Open-source projects such as Scribe and LogStash, on-premise tools like Splunk, and hosted services such as SumoLogic and PaperTrail. These all help you reduce mass amounts of log data into something more meaningful. And there’s one thing they all share in common. ...

Read More »

Never Test Logging

software-development-2-logo

Technical logging is usually not tested. As commentator write on stack overflow: I practice TDD/BDD pretty religiously and I almost never test logging. With some exceptions logging is either a developer convenience or a usability factor, not part of the method’s core specification. There is also a technical side why developers are reluctant, as Jon writes on the same page: ...

Read More »

Customizing Log4j 2.0

apache-log4j-logo

We are getting closer and closer to a Log4j 2 GA release and for that reason we should start looking into what it will give us. Personally I have a lot of reasons to be excited about Log4j 2.0. The community is great, the Apache License gives me a lot of freedom and finally it is protected by the Apache ...

Read More »

SLF4J Binding for ADFLogger – the Missing Piece

slf4j-logo

For reasons best left untold, in my day job, I was expected to provide an SLF4J Adapter for ADF Logger Oracle ADF. Not surprisingly, slf4j does not have an adapter for ADFLogger but since ADFLogger was just a gentle wrapper over Java Util Logging, it took a little over an hour to fill that gap. The testcases (more like main ...

Read More »

21st century logging

software-development-2-logo

I think logging should get more attention than we are currently giving it. When designing an application a great deal of effort goes into modelling the customer business logic, making sure all use cases are covered and handled properly. The business model is mapped to a persistence storage (be at a RDBMS or a NoSQL solution), frameworks are being chosen: ...

Read More »

How to create web-app with Quartz Scheduler and logging

quartz-scheduler-logo

I sometimes help out users in Quartz Scheduler forums. Once in a while some one would ask how can he/she setup the Quartz inside a web application. This is actualy a fairly simple thing to do. The library already comes with a ServletContextListener that you can use to start a Scheduler. I will show you a simple webapp example here. ...

Read More »

How to configure SLF4J with different logger implementations

slf4j-logo

There are many good benefits in using slf4j library as your Java application logging API layer. Here I will show few examples on how to use and configure it with different loggers. You can think of slf4j as an Java interface, and then you would need an implementation (ONLY ONE) at runtime to provide the actual logging details, such as ...

Read More »

Apache log4j is the leading logging framework

apache-log4j-logo

According to a survey from Zero Turnaround Apache log4j is the leading Java logging framework. This was actually a very interesting survey. It shows SLF4J is most often used as a logging facade with 61%. But it seems it is most often used with Apache Log4j, which is used by 52% of all survey participants. Just 29% use logback and ...

Read More »

SiftingAppender: logging different threads to different log files

logback-logo

One novel feature of Logback is SiftingAppender (JavaDoc). In short it’s a proxy appender that creates one child appender per each unique value of a given runtime property. Typically this property is taken from MDC. Here is an example based on the official documentation linked above:               <?xml version="1.0" encoding="UTF-8"?> <configuration> <appender name="SIFT" class="ch.qos.logback.classic.sift.SiftingAppender"> ...

Read More »
Want to take your Java Skills to the next level?
Grab our programming books for FREE!
  • Save time by leveraging our field-tested solutions to common problems.
  • The books cover a wide range of topics, from JPA and JUnit, to JMeter and Android.
  • Each book comes as a standalone guide (with source code provided), so that you use it as reference.
Last Step ...

Where should we send the free eBooks?

Good Work!
To download the books, please verify your email address by following the instructions found on the email we just sent you.