logging mechanism in web environment

Discussions

Web tier: servlets, JSP, Web frameworks: logging mechanism in web environment

  1. logging mechanism in web environment (1 messages)

      hi, i wonder if it is true that asynchronous logging mechanisms take advantage over the others. i have to do some application specific logging in a web application, and the logging should be reliable. since this is in a web environment, i don't want to place overhead on the web/app server. do i have to try socket or jms, and anybody who has experiences like this please give me some suggestions.
      thanks.
  2. Song,

    You can accomplish asynchronous logging in either one of two ways: put messages into a queue then read and log them from a separate thread; or use JMS. If you are using EJB, you might want to try JMS; Sun's J2EE specification frowns on using java.io... in EJB's. If you're looking for a really good existing logging API, try:
    http://jakarta.apache.org/log4j/docs/index.html. The authors have made every effort to make the log fast and give recommendations for using it to maximize performance. It includes an async adapter too.

    Regards,

    Gordon.