Skip to content
Andres Gomez Casanova edited this page Jun 9, 2022 · 6 revisions

History

I am Andres Gomez Casanova (AngocA) and I designed and developed this utility. I had the idea some time ago when I was with a client that was developing stored procedures, but it had problems with the business logic, and it was a very hard task to find the problem.

At that time, to get the origin of the problem, I created a table and inserted some messages on that table from the stored procedure. When the stored procedure was called, I was able to see the progress in another terminal by performing a query with UR. It was a very good solution and I could help my client to find the problem.

On the other hand, I love Java, and I have been a developer of this language for a long time. I like to check the new features and to know the more important frameworks. One of them is the well-known log4j and its successor logback/slf4j, which are very simple and powerful.

With these two things in mind, I asked myself if there should be a logging utility for Db2 because I could not be the first person with that problem. I did research on this topic to see what existed, and I found that there were many frameworks for other databases, such as Oracle, SQL server, but there is just one for DB2. I took a look at that for DB2, and I saw that it was not what I was exactly looking for (In one of the sections of this Wiki I wrote about the differences between DB2LOGGER and log4db2). So, I take the decision to create my own framework, by porting log4j to DB2 by writing it on SQL PL routines and tables.

First I published an article in my blog, because I did not have too much time to develop it at that time. Some months after, I had the same problem of hunting an error in a stored procedure, and then, I decided to start to code. This has been a long and dedicated adventure, but I have written a nice utility and at the same time I have learned a lot about Db2 programming.

Because I am convinced that this problem has been raised by other people, I want to share it with all of you, and that is the reason this project is Open Source. You are invited to use it, and give me some feedback about it, or improve it by adding new features (or correcting my English which is not, of course, my mother language).

The name

This is a difficult part because this is the way the people will identify the project. I always say that the name of a project is like the name of a son, you have to be comfortable with it when you talk about it. Thus, I make the decision to call him like the other projects ported from log4j: log4db2.

To give a meaningful description is also difficult because, in Db2, the word logging has a specific meaning about transaction logging. If it is not that word, it also has the meaning of the messages in the db2diag file. But, like the similar utilities for other databases, they call them logging 'utility' (Wikipedia calls log4j like that.) However, I have the possibility to give another description:

  • log4db2: a logging framework written in SQL-PL for DB2 LUW.
  • log4db2: a logging library written in SQL-PL for DB2 LUW.
  • log4db2: a logging engine written in SQL-PL for DB2 LUW.
  • log4db2: a logging facility written in SQL-PL for DB2 LUW.
  • log4db2: a logging system written in SQL-PL for DB2 LUW.
  • log4db2: a logging software written in SQL-PL for DB2 LUW.
  • log4db2: a logging tool written in SQL-PL for DB2 LUW.

What do you prefer? I called it utility.

Similar projects

For DB2

For Oracle

This part was improved from https://gist.github.com/jayvdb/fadf22ed54bcc3febaba

For Sybase and SQL Server

Generic database

Clone this wiki locally