Design Question


EJB design: Design Question

  1. Design Question (3 messages)

    Hi all
    I have to implement a Logger class. The code classes are availabe to me and I have to make them beans and deploy it on WebLogic App server.

    The heirarchy is almost like this -

    Logger interface - Logger abstract class and the implementaion

    LoggerFileImpl - which implements the Logger to log messages into
    a given File.

    I thought of making the LoggerFileImpl as an entity bean with BMP so that I don't have to make it a database row. Other than that I can easily implement my own persistant mechanism ( in this case a disk file ).

    Any suggestion and comments on this will be really helpful.



    Threaded Messages (3)

  2. Design Question[ Go to top ]

    The code to do this already exists in a number of places. The one I like best is log4j (Part of Apache.)

    It does what you want, but lets you change the persistent repository for the logged messages at run time, using configuration.

    If you must roll your own I wouldn't use an entity bean, as you are at the mercy of the application servers concurrency model. (WebLogic is pessimistic, that's one thread running through your logger at a time, big bottleneck)

    log4j seems complex at first but it's actually very easy to use, highly performant (logging is just about the easiest way to cripple the performance of your code) and is remarkably similar to the recent JSR on a common logging API, except that it exists now and is quite mature. :-)


  3. Design Question[ Go to top ]

    Hi Tony,
    could u suggest any starter kit for Log4j other than ( for starters, any examples with servlets.

    i would greatly appreciate any feedback and thanks for your time

  4. Design Question[ Go to top ]

    Done implementing Log4j :)