Multi-dimensional logging

Discussions

General J2EE: Multi-dimensional logging

  1. Multi-dimensional logging (4 messages)

    To try and satisfy logging requirements for multiple audiences (internal dev/tech support/customer) we are trying to find any recommended design patterns people may have used to provide multi-dimensional logs.

    By this we are not just talking about multiple log appenders or extending log4j etc with new log levels. We need a flexible and dynamically configurable way of controlling system and service log requirements. Innevitably some our code will require more than one handle to perform this.

    We are using apache commons with log4j and use the standard package/class name as logger name. We are thinking of prepending logger name with <log category type>. When instantiating the logger we'll use something like:
    OurLogFactory.getInstance( <log type> , logger name ).

    This should then allow us to separate and configure system/service layer log fairly easily, outputting to shared/separate loggers as desired.

    Is anyone aware of anyone good patterns that could help cater for this type of logging requirement?

    Threaded Messages (4)

  2. Multi-dimensional logging[ Go to top ]

    You could also look at logn: see http://logn.dev.java.net - it has the ability to route logs by name, and it allows multiple consumers for various messages too.
  3. different types of logger[ Go to top ]

    hi..

    i am not sure about the context of your requirement, but if you talking about logs for developers(where they need stack traces) and logs for users/system personnel(who just want to know where something failed), we use a wrapper class around the log4j logger. In this logger we override the normal logging methods(debug,info,etc) + we wrote some basic methods that takes in an exception object so that a more meaningful trace can be given to the developers.

    hope this helps..

    S
  4. Multi-dimensional logging[ Go to top ]

    Thanks for the pointers,

    Can't seem to find much on logn under java.net however. I'll try and do a few other searches, maybe it's been moved.

    We considered adding another log level/method e.g. logger.system(xx) but this doesn't really satisfy our need. We need two paralell log types, each with the same array of log level method calls.

    e.g.
    system level logger: debug, info, warn, error, fatal
    service level logger: debug, info, warn, error, fatal
    ...and possibly more in the future.

    So am thinking of prepending logger name strings to try and cater:
    e.g.
    service.com.something.mypackage.myclassX
    system.com.something.mypackage.myclassX


    Cheers, Ben
  5. Re: Multi-dimensional logging[ Go to top ]

    Thought you might be interested http://www.theserverside.com/news/thread.tss?m=c.reply&thread_id=47120#321790 How is it going with your multidimensional logging? Did you find any solution that does the trick? I am totally convinced that log cubes are the way to go. Cheers! -Dimitri