Question regarding use of Log and LogFactory in Servlets

Hi,

I saw the following code in an application and I would like to know where the log information would be stored. It appears that the log information is not displayed on the screen and was not able to find out where the log files are. The application was created using NetBeans and was using Tomcat. Thanks in advance.

import org.apache.common.logging.*;

public class Test extends HttpServlet

{

private static final Log log = LogFactory.getLog(Test.class);

String theHost;

String theSource;

public void init (ServletConfig config) throws ServletException

{

super.init(config);

log.info(揹ebug Enabled: ?log.isDebugEnabled());

ServletContext context =config.getServletContext();

this.thisHost=?Test/?config.getServletName();

etc. etc.

log.info(搕hisHost:?this.thisHost);

log.debug(揝ource:?+theSource());

etc, etc.

}

}

[936 byte] By [kms2007a] at [2007-11-27 9:57:45]
# 1

It depends on what logging system you have set up.

Commons.logging is an abstraction layer above logging components. It allows your code to use a variety of logging systems. However those logging systems have to be set up and configured by you. This can be via system properties, properties files, XML config files (depends on the logging system and how you use it).

So you need to figure out which logging system is being used and then configue that system to write the logs

matfud

matfuda at 2007-7-13 0:28:07 > top of Java-index,Java Essentials,Java Programming...