Are u using any static variables or trying to append the same entry to StringBuffer? can you post the code?
Main Topics
Browse All TopicsI have a log.entering() method call at the top of most of my methods. When a method is called, an entry is made in the log file as expected. When the method is entered a second time, two identical entries are made in the log file. When entered a third time, three identical entries are made in the log file. And so on...
Any ideas what's going on?
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Java Snippet:
...
public class AEF4690AccessBean{
...
public AEF4690AccessBean() {
String thisClassname = this.getClass().getName();
Logger log = ((JSpaLogger)JSpaServletLi
log.entering(thisClassname
...
}
--------------------------
log after 1st call:
Sep 23, 2005 1:00:15 PM com.softechnics.AEF4690Acc
FINER: ENTRY
log after 2nd call:
Sep 23, 2005 1:00:15 PM com.softechnics.AEF4690Acc
FINER: ENTRY
....
Sep 23, 2005 1:00:15 PM com.softechnics.AEF4690Acc
FINER: ENTRY
Sep 23, 2005 1:00:15 PM com.softechnics.AEF4690Acc
FINER: ENTRY
log after 3rd call:
Sep 23, 2005 1:00:15 PM com.softechnics.AEF4690Acc
FINER: ENTRY
....
Sep 23, 2005 1:00:15 PM com.softechnics.AEF4690Acc
FINER: ENTRY
Sep 23, 2005 1:00:15 PM com.softechnics.AEF4690Acc
FINER: ENTRY
...
Sep 23, 2005 1:00:15 PM com.softechnics.AEF4690Acc
FINER: ENTRY
Sep 23, 2005 1:00:15 PM com.softechnics.AEF4690Acc
FINER: ENTRY
Sep 23, 2005 1:00:15 PM com.softechnics.AEF4690Acc
FINER: ENTRY
etc....
Let me modify the above snippet to the exact code (in trying to keep it simple, it's possible I ommitted something important here):
...
public class AEF4690AccessBean{
...
Logger log = null;
...
public AEF4690AccessBean() {
String thisClassname = this.getClass().getName();
if (log == null) {
log = ((JSpaLogger)JSpaServletLi
}
log.entering(thisClassname
...
}
Very odd. It's as if the data is being kept in a buffer, written to the log file, but then not being cleared from the buffer...
I'm unfamiliar with this "Logger" class you're using -- is it custom? Is there some kind of flush() method with it?
Also, by redefining the log instance each time (ie., by removing the "if ( log == null )" line), then does this fix the problem? (I know this probably leaves some efficiency issues that would need to be resolved, but it would probably give us a better idea of what's causing the current problem..
One final question, if I may:
The Logger javadoc recommends a logger for each class, which I created. I assumed this meant a log file for each logger - not what I'd really want, but I was learning. As it turns out, there is only one log file. Are all loggers (for each class) sharing the one log file?
Every Class has this:
if (log == null) {
log = ((JSpaLogger)JSpaServletLi
}
Then each method within the Class has this:
log.entering(<Classname>.c
Have you read this? Check out the section on handlers for a start..
http://java.sun.com/j2se/1
Business Accounts
Answer for Membership
by: InteractiveMindPosted on 2005-09-23 at 12:07:16ID: 14947358
what information is stored in these entries?