Solved

LogFactory and Log

Posted on 2006-06-15
3
262 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 92

Expert Comment

by:objects
ID: 16916638
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
ID: 16917308
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:Mayank S
ID: 16920259
Yes, the log-file has to be defined somewhere - check your configuration and properties-files.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
In this post we will learn different types of Android Layout and some basics of an Android App.
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

617 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