Solved

LogFactory and Log

Posted on 2006-06-15
3
256 Views
Last Modified: 2008-02-26
First off, let me state I'm not a Java programmer.  I'm integrating some ASP .NET code with a Java Web App.  

My question is about the following line:

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

and then they use log.error(e) or log.debug....etc.

My question is, is this creating an actual log file somewhere on the system?  I want to be able to check it for errors if indeed that's what it's for.

Thanks.
0
Comment
Question by:moonshot
3 Comments
 
LVL 92

Expert Comment

by:objects
Comment Utility
the definition of the actually logger that will be written to will be in yourt loggoing config file, it may be going to a log file or it may not.
0
 
LVL 19

Accepted Solution

by:
Jim Cakalic earned 500 total points
Comment Utility
There /probably/ is a log file. That is the most common logging destination although Java logging systems can also log to a variety of other destinations. Since your example was with LogFactory, my suspicion is that the web app uses the jakarta commons-logging api (http://jakarta.apache.org/commons/logging/guide.html). This is a wrapper api that abstracts other logging subsystems. It doesn't actually do the logging itself. It delegates that activity to another logging package. It primarily came about because for quite some time the standard Java runtime class libraries did not include a specific logging api and various alternatives were advanced. As of JDK 1.4, there is the java.util.logging package (http://java.sun.com/j2se/1.4.2/docs/guide/util/logging/). Another very popular logging api is log4j (http://logging.apache.org/log4j/docs/).

If you look at the commons-logging guide, it has a section on configuration. This section will help you to understand how commons-logging discovers the logging api that it will wrap. You can go through the same process to figure out which logging package is actually being used. The other links will help you in understanding the configuration of log4j and java.util.logging and, assuming that the logging destination is actually a file, what that file is named and where it may be found.

Regards,
Jim Cakalic
0
 
LVL 30

Expert Comment

by:mayankeagle
Comment Utility
Yes, the log-file has to be defined somewhere - check your configuration and properties-files.
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now