Solved

LogFactory and Log

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Java Server Faces parameter pass? 6 39
Java SE 8u111  Lot of stuff broke 11 54
varialbe initialization 11 30
How to convert String matching to regex in java 4 21
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

896 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

12 Experts available now in Live!

Get 1:1 Help Now