Re: Memory Leaks in Log4j

2002-07-30 Thread Ceki Gülcü

At 19:46 30.07.2002 -0400, you wrote:

>i have heard people complaining about it in other sister projects in my 
>company. the out of memory condition generally seems to have occurred when 
>the application was made to process a lot of SNMP traps in a very brief 
>period of time. the same memory condition does not occur when logging is 
>turned off though. that application uses the console and file appenders.
>
>we are planning to use log4j version 1.2.5 for our project with the 
>JDBCAppender writing to Oracle. it would make me feel good if i knew if 
>there were any known issues with memory and Log4j.

Not to my knowledge no. The only known memory leak is when you do
NDC.push operations but forget to call NDC.remove() when leaving a
thread. This is a well-documented problem.

>On the aside, does anybody know since which version of Log4J, the 
>JDBCAppender was available ? Was it there from the very beginning ?

Since log4j 1.2rc1 which became available in May 2002 or so.

>Regards,
>Mohan.

--
Ceki


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Memory Leaks in Log4j

2002-07-30 Thread Krishna Mohan Nerella


i have heard people complaining about it in other sister projects in 
my company. the out of memory condition generally seems to have 
occurred when the application was made to process a lot of SNMP traps 
in a very brief period of time. the same memory condition does not 
occur when logging is turned off though. that application uses the 
console and file appenders.

we are planning to use log4j version 1.2.5 for our project with the 
JDBCAppender writing to Oracle. it would make me feel good if i knew 
if there were any known issues with memory and Log4j.

On the aside, does anybody know since which version of Log4J, the 
JDBCAppender was available ? Was it there from the very beginning ?

Regards,
Mohan.


Mark Womack wrote:

> Do you have any specific suspicions you are trying to confirm?
> 
> -Mark
> 
> 
>>-Original Message-
>>From: Krishna Mohan Nerella [mailto:[EMAIL PROTECTED]]
>>Sent: Tuesday, July 30, 2002 4:21 PM
>>To: [EMAIL PROTECTED]
>>Subject: Memory Leaks in Log4j
>>
>>
>>hello,
>>
>>has anybody experienced or is aware of memory leak problems 
>>with log4j 
>> ? if so i would like to know under what circumstances and how to 
>>fix/prevent them.



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Memory Leaks in Log4j

2002-07-30 Thread Mark Womack

Do you have any specific suspicions you are trying to confirm?

-Mark

> -Original Message-
> From: Krishna Mohan Nerella [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, July 30, 2002 4:21 PM
> To: [EMAIL PROTECTED]
> Subject: Memory Leaks in Log4j
> 
> 
> hello,
> 
> has anybody experienced or is aware of memory leak problems 
> with log4j 
>  ? if so i would like to know under what circumstances and how to 
> fix/prevent them.
> 
> Regards,
> Mohan.
> -- 
> Reality is just a convenient measure of complexity.
> - Alvy Ray Smith
> ---
> 
> 
> --
> To unsubscribe, e-mail:   
> 
> For additional commands, e-mail: 
> 
> 

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Memory Leaks in Log4j

2002-07-30 Thread Krishna Mohan Nerella

hello,

has anybody experienced or is aware of memory leak problems with log4j 
 ? if so i would like to know under what circumstances and how to 
fix/prevent them.

Regards,
Mohan.
-- 
Reality is just a convenient measure of complexity.
- Alvy Ray Smith
---


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




logger factory question

2002-07-30 Thread N. D.

Hi

I need some help regarding the configuration of logger factories.
I would like to define my own logger class for eg MyLogger, derived from
Logger, so that I can define additional interfaces and the users of my API can
still create the instances of MyLogger by making a call to
MyLogger.getLogger(). MyLogger.getLogger will internally create a logger using
an instance of MyLoggerFactory.

This works great except when I am using a PropertyConfigurator. If I define
multiple loggers in the configuration file and used PropertyConfigurator to
read and configure them, then all the instances created are Logger instances as
opposed to MyLogger. But in fact I would like them to be instances of MyLogger.
I couldn't get any documentation about how to configure this scenario and it
seems that the LoggerFactory configuration is no longer supported.

Is there any information available on either 1) how to configure the logger
factories to get correct logger instances or 2) alternate ways to extend the
logger functionality tailored to the application?

Thanks in Advance
--ND



__
Do You Yahoo!?
Yahoo! Health - Feel better, live better
http://health.yahoo.com

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




log4j config parameters

2002-07-30 Thread s s


Hi

How do I programatically construct following parameter instead of reading it from 
log4j config file:

log4j.appender.LogFile.File=c:\\temp\\test1.log

Thanks

Dcol



-
Do You Yahoo!?
Yahoo! Health - Feel better, live better


servlet logging

2002-07-30 Thread s s


Hi

I am new to log4j so this may sound a naive question. I am wondering what is the best 
way to create new log file for every single request for a servelet based webapp. Can 
somebody suggest a code example & sample log4j configuration file? 

Thanks

Dcol



-
Do You Yahoo!?
Yahoo! Health - Feel better, live better


RE: feature request: logging a stack trace

2002-07-30 Thread Mark Womack

Logging events also support something called location info.  It records
where the event was logged from and can be displayed via the PatternLayout
(see the javadoc for details).  It displays the stack from where the logging
event was recorded.  All you have to do is use the correct conversion
character in the PatternLayout.

But it will affect performance if displayed with every logging message (as
will your code below, I believe).

-Mark

> -Original Message-
> From: Hein Meling [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, July 30, 2002 12:48 PM
> To: Log4J Users List
> Subject: feature request: logging a stack trace
> 
> 
> hi.
> 
>   sorry if this is not the right place for this kind of request, but i
> don't want to subscribe to the developers list.
> 
>   anyway, sometimes it may be very useful to log a stack 
> trace, even if
> there was no exception, in order to determine from where a method is
> being called.  is this idea something that could be interesting to add
> to the Logger (or Category) class in Log4j?  That is a method like:
> logStackTrace(), or whatever...
> 
>   my implementation (residing in a class called Debug) is 
> very rough so,
> it needs a bit of cleaning up to fit well into log4j:
> 
> 
>   public static void logStackTrace(org.apache.log4j.Logger log)
>   {
> try {
>   throw new Exception();
> } catch (Exception e) {
>   StringWriter swriter = new StringWriter();
>   e.printStackTrace(new PrintWriter(swriter));
>   log.debug(swriter.toString());
> }
>   }
> 
> 
>   comments?
> 
> ciao,
> - hein
> 
> --
> To unsubscribe, e-mail:   
> 
> For additional commands, e-mail: 
> 
> 

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: feature request: logging a stack trace

2002-07-30 Thread Jon Skeet

>   my implementation (residing in a class called Debug) is 
> very rough so,
> it needs a bit of cleaning up to fit well into log4j:
> 
> 
>   public static void logStackTrace(org.apache.log4j.Logger log)
>   {
> try {
>   throw new Exception();
> } catch (Exception e) {
>   StringWriter swriter = new StringWriter();
>   e.printStackTrace(new PrintWriter(swriter));
>   log.debug(swriter.toString());
> }
>   }

There's no need to throw an exception in order to log it - just create it. The rest is 
fine, although I thought Log4j already had some exception formatting code somewhere...

Jon

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




feature request: logging a stack trace

2002-07-30 Thread Hein Meling

hi.

  sorry if this is not the right place for this kind of request, but i
don't want to subscribe to the developers list.

  anyway, sometimes it may be very useful to log a stack trace, even if
there was no exception, in order to determine from where a method is
being called.  is this idea something that could be interesting to add
to the Logger (or Category) class in Log4j?  That is a method like:
logStackTrace(), or whatever...

  my implementation (residing in a class called Debug) is very rough so,
it needs a bit of cleaning up to fit well into log4j:


  public static void logStackTrace(org.apache.log4j.Logger log)
  {
try {
  throw new Exception();
} catch (Exception e) {
  StringWriter swriter = new StringWriter();
  e.printStackTrace(new PrintWriter(swriter));
  log.debug(swriter.toString());
}
  }


  comments?

ciao,
- hein

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




log4j version problem

2002-07-30 Thread srinivas . dutt

Hi,
When i am using log4j-1.2.4.jar getting the following error. if i am using 
log4j.jar then works fine. Please help me. It is very urgent.

Exception in thread "main" java.lang.NoSuchMethodError
at net.sourceforge.poi.hssf.HSSFLog.(HSSFLog.java:107)
at
net.sourceforge.poi.hssf.model.Workbook.(Workbook.java:131)
at
net.sourceforge.poi.hssf.usermodel.HSSFWorkbook.(HSSFWorkbook.j
ava:127)
at HelloExcel.main(HelloExcel.java:9)

Thanks and Regards,
srinivasa dutt

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Help with Log4j automatic header generataion

2002-07-30 Thread Klein, Scott @ TW

Very simple -

Just extend PatternLayout (thats what your example looks like), or any other
layout and over-ride the getHeader() and/or getFooter() methods. Then just
name your class as the layout in the config file.



scott


-- ex ---
public class MyPatternLayout
extends PatternLayout
{
public 
MyPatternLayout()
{
super();
}

public String 
getHeader()
{
Date now = new Date();
SimpleDateFormat sdf = 
new SimpleDateFormat( ".MM.dd 'at' HH:mm:ss.SSS z" );

StringBuffer buf = new StringBuffer();
buf.append( "=== My Log File ===\r\n" );
buf.append( "Log started: " );
buf.append( sdf.format( now ) );
buf.append( "\r\n" );
buf.append( ReleaseVersion.getVersionString() );
buf.append( "\r\n\r\n" );

String superHeader = super.getHeader();
if ( superHeader != null ) {
buf.append( superHeader );
}

return new String(buf);
}
}

-Original Message-
From: McKinnon, Cory [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 30, 2002 6:32 AM
To: '[EMAIL PROTECTED]'
Subject: Help with Log4j automatic header generataion


Hi,

I am simply prototyping a very small Log4j application, however, one of the 
requirements we must prove to the client is for an automatic header
generation 
for the log messages.  Example:


DATEFUNCCLASS / LINE NUMBERLVL
MESSAGE
2002-07-29 15:26:08,086 [main] (log4jexample.TestLogging : 16) DEBUG -
message1
2002-07-29 15:26:08,101 [main] (log4jexample.TestLogging : 17) INFO  -
message
2002-07-29 15:26:08,101 [main] (log4jexample.TestLogging : 18) WARN  -
message3
2002-07-29 15:26:08,101 [main] (log4jexample.TestLogging : 19) ERROR -
message4
2002-07-29 15:26:08,164 [main] (log4jexample.TestLogging : 20) FATAL -
message5

Any help is much appreciated.

Cheers,

Cory


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Log4j dailyrollingfileapender issue

2002-07-30 Thread Keys, Andrew T

group,

I have six processes reading the same log4j properties file.  They
all write to the same output file bvlog.java.out.  The problem is during log
rotation at midnight.  The previous day gets written to
bvlog.java.out.07292002, but only one process goes to the new
bvlog.java.out.  The others stay on bvlog.java.out.07292002.  How can I get
all 6 processes to roll when the file is changed?  Any help would be
appreciated.  Here is my log4j properties file.

Thanks,

Andy

#here is the log level for the root Category.
#By default it is ERROR, It can be DEBUG or INFO or WARN or ERROR or FATAL
#the entry R is the name of root appender. This does not requires to be
changed.

log4j.rootCategory=ERROR, R

#By default the output of the logging goes to System.err
#This can be directed to a file by providing the file name (complete path)
#log4j.appender.A1.File=System.err

#On unix the format is like following.
#log4j.appender.A1.File=/home/user/sdklogs/logfile.log

log4j.appender.R.File=/home/bv/bvadm/bv1to1_var/logs/txdmz59/bvlog.java.out

#the following entry need not be changed.
#the format of the log message

log4j.appender.R=org.apache.log4j.DailyRollingFileAppender
log4j.appender.R.DatePattern='.'MMdd
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%d %p [%c] [%t] - %m%n

# These next few enrtees set up the number of threads that will be used 
# by the Yodlee Handler for shared pooling and how long they set idle

NumSocket = 20

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: filtered exception logging

2002-07-30 Thread Leos Literak

OK, thank you, I will think about implementation.
And sorry for sending it twice - it didn't show
on webarchive of conference after 3 days, so I
sent it again.

Leos

-- 
Leos Literak
http://AbcLinuxu.cz - tady je tucnakum hej!


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Help with Log4j automatic header generataion

2002-07-30 Thread McKinnon, Cory

Hi,

I am simply prototyping a very small Log4j application, however, one of the 
requirements we must prove to the client is for an automatic header
generation 
for the log messages.  Example:


DATEFUNCCLASS / LINE NUMBERLVL
MESSAGE
2002-07-29 15:26:08,086 [main] (log4jexample.TestLogging : 16) DEBUG -
message1
2002-07-29 15:26:08,101 [main] (log4jexample.TestLogging : 17) INFO  -
message
2002-07-29 15:26:08,101 [main] (log4jexample.TestLogging : 18) WARN  -
message3
2002-07-29 15:26:08,101 [main] (log4jexample.TestLogging : 19) ERROR -
message4
2002-07-29 15:26:08,164 [main] (log4jexample.TestLogging : 20) FATAL -
message5

Any help is much appreciated.

Cheers,

Cory