~/devreads

#logging

13 posts

17 Jan 2023

lukaseder 1 min read

jOOQ already has a LoggingConnection (see also the manual), which acts as a JDBC proxy Connection to log all SQL statements that are executed by any JDBC client (including Hibernate, MyBatis, JdbcTemplate, native JDBC, etc.). Starting from jOOQ 3.18.0, 3.17.7, and 3.16.13, a LoggingConnection is now also available for R2DBC clients to log all reactive … Continue reading jOOQ’s R2DBC…

jooq-in-usejooqloggingr2dbc

21 Dec 2022

vladmihalcea 1 min read

Introduction In this article, we are going to see how to configure a Spring application to use MDC (Mapped Diagnostic Context) for transaction logging. This technique is going to help us inject the Persistence Context information as well as the associated database transaction identifier in all the log entries emitted from within a @Transactional service method. MDC (Mapped Diagnostic Context)…

springloggingmdctransactionaltransactions

30 Aug 2020

Henrik Warne 5 min read

You have developed a new feature. The code has been reviewed, and all the tests pass. You have just deployed this new feature to production. So on to the next task, right? Wrong. Most of the time, you should check … Continue reading →

programmingtestingdeployingloggingproduction

23 Jul 2020

Henrik Warne 5 min read

To check if a program is doing what it should, you can inspect the output from a given input. But as the system grows, you also need logging to help you understand what is happening. Good log messages are crucial … Continue reading →

debuggingprogramminglogging

10 Jul 2018

25 Jan 2017

Dave Cheney 2 min read

In my previous post I suggested that the best way to break the compile time coupling between the logger and the loggee was passing in a logger interface when constructing each major type in your program. The suggestion has been floated several times that logging is context specific, so maybe a logger can be passed around via […]

goprogrammingdesignlogging

23 Jan 2017

Dave Cheney 2 min read

This post is a spin-off from various conversations around improving (I’m trying not to say standardising, otherwise I’ll have to link to XKCD) the way logging is performed in Go projects. Consider this familiar pattern for establishing a package level log variable. package foo import “mylogger” var log = mylogger.GetLogger(“github.com/project/foo”) What’s wrong with this pattern? The first problem […]

goprogrammingdesignlogging

5 Nov 2015

Dave Cheney 5 min read

This is a post inspired by a thread that Nate Finch started on the Go Forum. This post focuses on Go, but if you can see your way past that, I think the ideas presented here are widely applicable. Why no love ? Go’s log package doesn’t have leveled logs, you have to manually add prefixes like […]

goprogrammingsmall ideasdesignlogging

19 Jan 2015

lukaseder 1 min read

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 … Continue reading Using Java…

javajava 8loggingstring manipulation

21 Jan 2014

Henrik Warne 4 min read

To trouble-shoot software, logging of some kind is essential. But for most systems, it is simply not possible to log everything that happens. Many systems and logging frameworks let you limit the amount of data by giving a logging level (e.g. … Continue reading →

debugginglogginglogging frameworklogging levelsession

1 Jan 2014

Henrik Warne 4 min read

One common reaction to my post on writing debuggable code was: you don’t need logging, just use a debugger. While there are cases where a debugger is the best option, there are many reasons why having proper logging in place … Continue reading →

debuggingdebuggerloggingtrouble-shooting

9 Nov 2013

Henrik Warne 1 min read

When there is a problem with your software, the first thing you usually ask for is a log showing what happened (provided you write debuggable code), and the version of the software that was running. But it is easy to … Continue reading →

debuggingloggingrevisionsubversionsvn

5 May 2013