Solved

LogFactory and Log

Posted on 2006-06-15
3
259 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
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
session migration servlets 2 42
diffSum example 4 50
Maven Project: Hibernate Dependencies Conflict 10 38
Adding multiple JVM environments to RedHat 6 7 45
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 …
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

807 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