Category Archives: logdoc

XINS 3.0 Beta1 Released

Just now I tagged 3.0-beta1 of my experimental XINS fork (which is not so experimental from the perspective that it has been running in production-sites since 2007).

Source and related stuff available from GitHub:

For a complete download, get this ZIP package:

Recent changes include:

  • Ant 1.8.0 is now properly supported
  • Logdoc definitions are now validated using XSDs (Logdoc 0.3 included)
  • Default runtime config file reload interval is now 5 instead of 60 seconds.
  • Not initializing logging subsystem (Log4J) if system property org.xins.server.logging.init is set to false.
  • Not setting context IDs (in Log4J terminology: NDC.push() calls) if property org.xins.server.contextID.push is set to false (system, bootstrap or runtime property).
Leave a comment

Posted by on 28 April 2010 in ant, apache ant, github, logdoc, xins, xins3


XINS 3.0 Alpha3 and Logdoc 0.2

>I’ve just released the 3.0-alpha3 version of my XINS fork, which includes the also just released Logdoc 0.2. See:

Compared to version 0.1, Logdoc 0.2 is cleaned up: the internal logging output is now sent via Ant, meaning that the Ant options -verbose and -debug are needed to see all output. This improves usability.

XINS 3.0-alpha3 introduces lots of small changes, mostly cleanup and minor corrections. A functional change is the introduction of client-side transaction logging via the log messages 2300 and 2301. The former includes the input/output parameters, while the latter does not.

Note that my XINS 3.0 fork is based off XINS 2.2-alpha2. Porting the changes from the 2.x branch to my 3.0-fork is one of my next challenges. Help in this area would be much appreciated! If you are keen and precise and know a bit about Java coding, let me know via ernst [at] ernstdehaan com.

Leave a comment

Posted by on 23 January 2010 in logdoc, xins


XINS 3.0 Alpha2 and Logdoc 0.1

>Just now I’ve released the 3.0-alpha2 version of my XINS branch, at:

Main feature is that Logdoc has been factored out into its own project, of which I’ve released version 0.1:

Logdoc is used to specify log mesages separate from code, generating both Log4J code and web documentation.

Possibly Logdoc can be extended to support code generation to other environments, including Apache Commons Logging, Log4PHP, Log4C, etc.

Another change made to XINS is that all source code is now under src/java making it much easier to work on XINS from an IDE.

So most of the previously presented random ideas have been implemented already…

Leave a comment

Posted by on 11 January 2010 in logdoc, xins


Random Ideas for XINS and Logdoc

>Here’s a random list of possible enhancements to XINS.

First, a couple of changes that would make it much easier to configure an IDE (such as Eclipse or NetBeans) to work with XINS:

  • Move all Java source code to src/java/; currently it is spread out over src/java-common, src/java-client-framework and src/java-server-framework. Still, the JAR files can remain the same.
  • Put the generated Java source files also under src/java/, such as the Log and TranslationBundle classes.
  • Put all generated class files under build/classes/.
  • Make the Library classes detect the XINS version at runtime, instead of using a text replacement technique to modify the source code before compiling it.
Then some ideas on Logdoc:
  • Split out Logdoc from XINS. It’s not needed inside XINS, all it needs is a JAR file and some Ant tasks for generating some stuff (like the Java source files and the documentation).
  • Make it easy to plug in a different logging library. Currently, Logdoc generates Log4J code, but it should be fairly simple to make it generate code for other logging libraries. It doesn’t mean Logdoc should actually implement this, but it would at least facilitate it.
To be continued.
1 Comment

Posted by on 30 December 2009 in java, logdoc, xins, xins3


>XINS: Splitting out Logdoc?

>Talking to Anthony Goubard yesterday (of JLearnIt and AntCommander fame), I realized that adding features like SMTP– and SMS-support to a Web Services framework like XINS can hardly be considered good separation of concerns. So I definitely need to revise my XINS 3.0 wishlist.

Instead, it may be a much better idea to make XINS focus more on the Web Services functionality and split some technologies out. The main candidates seem to be Logdoc and the ServiceCaller framework:
In the picture the arrows indicate dependencies. So XINS would depend on Logdoc and the ServiceCaller framework and the latter would also depend on Logdoc.

Logdoc: What is it?
In this post I will focus on Logdoc.

So what is Logdoc and why would we want to separate that out from XINS? Is it useful for other projects as well?

IMHO the answer is “yes”. Logdoc is a logging system based on the infamous Apache Log4J library that offers some features over Log4J:

  • registered logging categories: there is an explicit list of all logging categories, with documentation;
  • unique log messages: each log message is in a specific category and gets a specific number; this allows system administrators to enable or disable individual messages;
  • multi-locale: it is straight-forward to add a new language for log messages;
  • separation of concerns: the code does not bother with log levels, translations and categories, instead it just deals with a single log message (identified by ID) and it’s parameters.

Logdoc code example
Here is an example of a piece of Java code that uses Logdoc, from the HTTPServiceCaller class (javadoc/source):

// Unknown host
if (exception instanceof UnknownHostException) {
Log.log_1102(url, params, duration);

Notice that there is no category, no creation of objects and no language-specific stuff.

Logdoc definitions
The key to the Logdoc system is the definition of categories and entries in XML. Every entry is within a single category. Translations can be specified in separate files, one per language/locale. So for example, for the XINS/Java Server Framework, the following files define all logdoc entries and their translations:

  • src/logdoc/server/log.xml – defines all categories and contained entries; each entry has a unique number, it specified a log level and optionally some parameters;
  • src/logdoc/server/translation-bundle-en_US.xml – defines all U.S. English translations for the log messages defined in the log.xml file;
  • src/logdoc/server/translation-bundle-fr_FR.xml – defines all French (France) translations;

Adding a new set of translations is as easy as adding one line to the log.xml and one translation-bundle-xx_XX.xml file, where xx is the ISO language code and XX is the ISO country code.

Now from these specifications, both code and documentation is automatically generated, XINS-style. Here is an example of generated Logdoc documentation:

Notice that there are 2 ways to find log entries: by category and by ID (see the Logdoc entry list link at the top).

More information
For more information on Logdoc, check out the section titled “Managing logs” in the XINS User Guide.

Leave a comment

Posted by on 8 January 2008 in log, logdoc, logging, servicecaller, web services, xins, xins3