RE: help with appender problem

2003-02-12 Thread Klein, Scott @ TW
set additivity=false

-Original Message-
From: Kevin Hale Boyes [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 12, 2003 10:54 AM
To: [EMAIL PROTECTED]
Subject: help with appender problem


I've just started using Log4J in my Struts-based web application.  The
application directly uses commons-logging but it is configured to use
Log4J.

I'm having a problem in that messages are logged twice.  I suspect it has
to do with the way I've configured my appenders (because of the line in the
user manual that says "In other words, appenders are inherited additively
from 
the logger hierarchy.") but I can't see what the problem is.

Here is my log4j.properties file:

log4j.rootLogger=DEBUG
log4j.debug=true

log4j.logger.com.illuminat.cml=DEBUG, rolling
log4j.logger.org.apache=WARN, stdout
log4j.logger.org.apache.struts=DEBUG
log4j.logger.org.apache.struts.util.PropertyMessageResources=WARN

log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n

log4j.appender.rolling=org.apache.log4j.DailyRollingFileAppender
log4j.appender.rolling.File=rolling-output.log
log4j.appender.rolling.layout=org.apache.log4j.PatternLayout
log4j.appender.rolling.layout.ConversionPattern=%d - %p %c - %m%n


The intention is to not have an appender on the rootLogger but only
on the child loggers.  So I want messages for the "com.illuminat.cml" logger
to go only to the rolling appender and messages for the "org.apache" logger
to go only to the console.

Can anyone see why I'm getting messages from the "org.apache" logger printed
twice as shown in the following output:


DEBUG [main] (ActionServlet.java:1396) - Mapping for servlet 'action' =
'*.do'
1074 [main] DEBUG action.ActionServlet  - Mapping for servlet 'action' =
'*.do'
DEBUG [main] (ActionServlet.java:902) - Initializing module path '' 
configuration from '/WEB-INF/struts-config.xml'
1078 [main] DEBUG action.ActionServlet  - Initializing module path '' 
configuration from '/WEB-INF/struts-config.xml'


The first line of the message output corresponds to the
log4j.appender.stdout.layout.ConversionPattern defined above but the second
line doesn't seem to correspond to any pattern I've defined.

Thanks for any help,
Kevin.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Help with Log4j automatic header generataion

2003-01-31 Thread Klein, Scott @ TW
I guess it depends on what the user really wants, but it seems that there
should be some checking (or an option) to alter the behavior of writing a
header to anything but a "fresh" file. I could see where you might want a
continous log regardless of shutdown, and also where you may want a header
to signal the restart of the log

-Original Message-
From: David Sanders [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 30, 2003 6:02 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: RE: Help with Log4j automatic header generataion


http://www.mail-archive.com/log4j-user@jakarta.apache.org/msg05953.html


Thank you for the solution.  One problem, though:  If the logging 
process (JVM) is stopped and restarted, a 2nd header is written to the 
existing file.

Example:
- using DailyRollingFileAppender
- logged record #1.  Header was written first by MyPatternLayout.
- logged record #2
- Stopped process
- Started process
- logged record #3.  Header and record #3 were appended to existing file.

I don't want the header written if it's not a new file.  I'll see if 
PatternLayout can call theFile.length() and only write if length is 0.


David



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: DOMConfigurator issues

2003-01-30 Thread Klein, Scott @ TW
Not sure if there is a way to do it via the prop files (doesn't seem like it
should be), but you could just subclass the file appender and overload the
setFile method. Pretty simple.

-Original Message-
From: sk k [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 30, 2003 1:24 PM
To: [EMAIL PROTECTED]
Subject: DOMConfigurator issues


Hi,

I am having problem writing a xml config file for
log4j. Like I need to subsitute -D option values into
xml config file.

Eg: java -Dlogdir=C:/java  TestLogger

Substituting the logdir value into log4j.xml as shown
below(shown by an arrow).

log4j.xml
-
 
  
 
<---
 
 
  


Can somebody pls let me know if DOMConfigurator
supports substituting values into log4j.xml file that
were passed as -D option.

I really don't want to do the substitution based on
environment values.




__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Scalability: Seeking advice on logger names

2003-01-17 Thread Klein, Scott @ TW
Mike -

I use class level granularity (as recommended by several members of this
list) and have not seen performance or resource issues arise using 100s (if
not 1000+) of loggers. Personally I have not had much need for class-level
control of my loggers, but we still are in the habit of removing the
majority of our debug statements before check-in - once we get a comfort
level with keeping them in I am sure we will be very glad to have
class-level control of logging!



-Original Message-
From: Lutz Michael [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 17, 2003 8:10 AM
To: 'Log4J Users List'
Subject: Scalability: Seeking advice on logger names



For systems consisting of thousands and possibly even tens of thousands of
classes,
are there scalability advantages to naming loggers by their package name
only,
as opposed to scoping completely down to the class name?  (Specifically
referring to
the "Logger.getLogger("a.b.class");" call.)

I'm thinking there may be reasons (for scalability) not to include the
actual class
name in the logger names, and just stop at the lowest level package name.

Your thoughts are appreciated.
 
Mike


---
This message and any included attachments are from Siemens Medical Solutions

Health Services Corporation and are intended only for the addressee(s).  
The information contained herein may include trade secrets or privileged or 
otherwise confidential information.  Unauthorized review, forwarding,
printing, 
copying, distributing, or using such information is strictly prohibited and
may 
be unlawful.  If you received this message in error, or have reason to
believe 
you are not authorized to receive it, please promptly delete this message
and 
notify the sender by e-mail with a copy to [EMAIL PROTECTED]  Thank you

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




RE: easy way to create LoggingEvent objects out of a logfile?

2003-01-09 Thread Klein, Scott @ TW
See org.apache.log4j.chainsaw.XMLFileHandler and
org.apache.log4j.chainsaw.EventDetails

As for loading files, there is a LoadXMLAction class that handles this, all
the tools are there to do what you describe. 

-Original Message-
From: Mark Womack [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 09, 2003 10:25 AM
To: 'Log4J Users List'
Subject: RE: easy way to create LoggingEvent objects out of a logfile?


I believe that Chainsaw can view log files created using the XMLLayout.

-Mark

> -Original Message-
> From: Garhoefer Andreas [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, January 09, 2003 1:15 AM
> To: '[EMAIL PROTECTED]'
> Subject: easy way to create LoggingEvent objects out of a logfile?
> 
> 
> hi to all!
> 
> I'm rather new to log4j and I would like to know if there is 
> an easy way to
> create LoggingEvent objects out of an already existing 
> logfile. My aim is to
> 
> allow remote viewing of logfiles via Chainsaw and as far as I can see
> Chainsaw is not able to access files directly (is that true?).
> 
> thanx in advance
> andreas
> 

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

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




RE: STDOUT & STDERR in jboss

2003-01-03 Thread Klein, Scott @ TW
True enough, but what about when you want to turn off a certain logger? If
you turn off the STDOUT/STDERR logger _all_ events to it will be shut off. 

One of the great powers of log4j is in the logger naming hierarchy and using
(java) package based logger names. This allows you to turn on/off output
from specific classes/packages. However, if I have logger 'STDOUT' for
System.out and 'STDERR' for System.err then when I turn off those loggers I
will not see any their output from anywhere. For me anyway this is not the
desirable effect.

Besides, as I await the outcry from my fellow developers for turning off the
STDOUT and STDERR my response is thus:

logger.debug
System.out.println


using log4j is 35% more efficient! change the logger name to log and it is
almost twice as efficient!!

-Original Message-
From: Jonathan Cowherd [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 03, 2003 8:52 AM
To: 'Log4J Users List'
Subject: RE: STDOUT & STDERR in jboss


For the most part, but I usually rely on the message content to determine
where the call is coming from.  It would be nice if I could do something at
runtime so that old applications wouldn't need to be changed...   I know,
how lazy can I be.  :)

I'll post the question to the jboss users list and maybe someone can point
me to where they've done it.

Thanks.

Jonathan Paul Cowherd
Linux and Java Administrator
Genscape, Inc.
Email:  [EMAIL PROTECTED]
Office: (502) 583-3730
Mobile: (502) 314-0444



-Original Message-
From: Klein, Scott @ TW [mailto:[EMAIL PROTECTED]] 
Sent: Friday, January 03, 2003 11:35 AM
To: 'Log4J Users List'
Subject: RE: STDOUT & STDERR in jboss


This would be a nice addition, I am sure there are some issues though. 

I recently added code to send System.out and System.err to a
NullOutputStream in order to "encourage" use of log4j. I thought about doing
something similar to this but the problem you run into is that
System.out/err will go to a separate logger than the one obtained by the
class (and all of these calls will go to the same logger). So you lose the
advantage of knowing where the System.out/err calls are coming from.

hope that makes sense

-Original Message-
From: Jonathan Cowherd [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 03, 2003 8:26 AM
To: '[EMAIL PROTECTED]'
Subject: STDOUT & STDERR in jboss


JBOSS redirects all System.err and System.out to log4j some how.  Is this
something the JBOSS group did or is it something that is a part of log4j?

[2003-01-03 10:35:51,740,root] Installed System.out adapter [2003-01-03
10:35:51,742,root] Installed System.err adapter

Jonathan Paul Cowherd
Linux and Java Administrator
Genscape, Inc.
Email:  [EMAIL PROTECTED]
Office: (502) 583-3730
Mobile: (502) 314-0444


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




RE: STDOUT & STDERR in jboss

2003-01-03 Thread Klein, Scott @ TW
This would be a nice addition, I am sure there are some issues though. 

I recently added code to send System.out and System.err to a
NullOutputStream in order to "encourage" use of log4j. I thought about doing
something similar to this but the problem you run into is that
System.out/err will go to a separate logger than the one obtained by the
class (and all of these calls will go to the same logger). So you lose the
advantage of knowing where the System.out/err calls are coming from.

hope that makes sense

-Original Message-
From: Jonathan Cowherd [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 03, 2003 8:26 AM
To: '[EMAIL PROTECTED]'
Subject: STDOUT & STDERR in jboss


JBOSS redirects all System.err and System.out to log4j some how.  Is this
something the JBOSS group did or is it something that is a part of log4j?

[2003-01-03 10:35:51,740,root] Installed System.out adapter [2003-01-03
10:35:51,742,root] Installed System.err adapter

Jonathan Paul Cowherd
Linux and Java Administrator
Genscape, Inc.
Email:  [EMAIL PROTECTED]
Office: (502) 583-3730
Mobile: (502) 314-0444


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

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




RE: How do I use root logger?

2002-08-19 Thread Klein, Scott @ TW

not saying whether that this is how it is supposed to work, but you may want
to try adding a match level filter to the root's file appender



-Original Message-
From: Sudhir Kamatkar [mailto:[EMAIL PROTECTED]]
Sent: Monday, August 19, 2002 10:43 AM
To: Log4J Users List
Subject: How do I use root logger?



What I have:
1) Three applications/modules using log4j logging and want to log to three
different logfiles
2) These three applications have one logger defined for each (log1, log2,
log3) with different levels for each logger. 
3) I have defined 3 appenders apndr1, apndr2, apndr3 and have association
defined between log1->apndr1, log2->apndr2 and log3->apndr3 
4) I would like to have a separate log file (fourth one) which will have
ONLY 'FATAL' messages from all three applications.
5) Hence I defined root logger and associated appender4 to it for
level="fatal"
6) I thought this would do what I want (as explained in #4). But it doesn't
seem to work. What happens is root appender logs all the messages from
lowest level (out of 3) onwards for all 3 loggers. Essentially it looks like
root has no regard to it's own level specified. The lowest level value of
all 3 categories is what root logger uses?
7) I tried different combinations of additivity attribute too. Could not
succeed.. 
8) I tried using logger for "app" instead of root logger. Could not
succeed...
9) I am using log4j_1_2_6 and xmlconfiguration file

Can anyone please let me know if I am doing something wrong, or there is
workaround or this is not possible?

Here is the part of xmlconfiguration file I am using:



















Thank you for your help,


Sudhir

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




RE: How to add Filter to an Appender

2002-08-15 Thread Klein, Scott @ TW

\src\java\org\apache\log4j\xml\examples

-Original Message-
From: Samuel Cheung [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 15, 2002 12:04 PM
To: 'Log4J Users List'
Subject: RE: How to add Filter to an Appender


Mark,

Thanks. Is there a sample configure file for DOMConfigurator in the example
directory?
I can't find it there.

Sam

-Original Message-
From: Mark Womack [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 15, 2002 11:56 AM
To: 'Log4J Users List'
Subject: RE: How to add Filter to an Appender


I do not believe that filters are supported in the PropertyConfigurator.
You'll need to use DOMConfigurator.

-Mark

> -Original Message-
> From: Samuel Cheung [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, August 15, 2002 9:54 AM
> To: 'Log4J Users List'
> Subject: How to add Filter to an Appender
> 
> 
> Hi,
> 
> Could some one please tell me how to add a Filter to an 
> appender in log4j
> config file?
> 
> I add this in my config file
> log4j.appender.A2.filter=org.apache.log4j.varia.LevelMatchFilter
> 
> but I got the following warning:
> log4j:WARN Failed to set property [filter] to value
> "org.apache.log4j.varia.LevelMatchFilter". 
> 
> Thanks.
> Sam
> 
> --
> To unsubscribe, e-mail:   
> 
> For additional commands, e-mail: 
> 
> 

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

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

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




RE: Root appenders, application appenders, oh no!

2002-08-13 Thread Klein, Scott @ TW

dude, how about some nice appender names :)

+ first, set additivity to false on the appenders so they don't get passed
to the root logger

+ then add filters to your appenders, to filter out the proper events

org.apache.log4j.varia.LevelMatchFilter for the SMTP's, for example


of course, this is purely theoretical, I don't test the stuff ;)

-Original Message-
From: Tom Marsh [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 13, 2002 11:28 AM
To: Log4J User List
Subject: Root appenders, application appenders, oh no!


All:

If anyone can help with this, I'd appreciate it.

I have an application that I want WARN level and above to go to the 
console (stdout).

I want DEBUG and above to go to sockethubappender.

I want ERROR to go to SMTPAppender

I want FATAL to go to another SMTPAppender.

My problem is that debug's going to stdout as well as 
Sockethubappender, and ERROR emails are getting fired for FATAL levels.

Help!

Attached is my logfile:

#Turn on debugging for log4j
log4j.debug

log4j.rootLogger=WARN, WARN_CONSOLE

log4j.logger.FACCBean=DEBUG, ERROR_MAIL, FATAL_MAIL, DEBUG_SOCKET

#Appender WARN_CONSOLE
log4j.appender.WARN_CONSOLE=org.apache.log4j.ConsoleAppender
log4j.appender.WARN_CONSOLE.layout=org.apache.log4j.PatternLayout
log4j.appender.WARN_CONSOLE.layout.ConversionPattern=%d{ISO8601} %-4r %-5p
[%t] %
37c %3x - %m%n

#Appender ERROR_MAIL
log4j.appender.ERROR_MAIL=org.apache.log4j.net.SMTPAppender
log4j.appender.ERROR_MAIL.Threshold=ERROR
log4j.appender.ERROR_MAIL.layout=org.apache.log4j.PatternLayout
log4j.appender.ERROR_MAIL.BufferSize=1
[EMAIL PROTECTED]
log4j.appender.ERROR_MAIL.SMTPHost=mail..com
log4j.appender.ERROR_MAIL.Subject=ERROR FACC
[EMAIL PROTECTED]
log4j.appender.ERROR_MAIL.layout.ConversionPattern=%d{ISO8601} %-4r %-5p
[%t] %
37c %3x - %m%n

#Appender FATAL_MAIL
log4j.appender.FATAL_MAIL=org.apache.log4j.net.SMTPAppender
log4j.appender.FATAL_MAIL.Threshold=FATAL
log4j.appender.FATAL_MAIL.layout=org.apache.log4j.PatternLayout
log4j.appender.FATAL_MAIL.BufferSize=1
[EMAIL PROTECTED]
log4j.appender.FATAL_MAIL.SMTPHost=mail..com
log4j.appender.FATAL_MAIL.Subject=FATAL FACC
[EMAIL PROTECTED]
log4j.appender.FATAL_MAIL.layout.ConversionPattern=%d{ISO8601} %-4r %-5p
[%t] %
37c %3x - %m%n

#Appender DEBUG_SOCKET
log4j.appender.DEBUG_SOCKET=org.apache.log4j.net.SocketHubAppender
log4j.appender.DEBUG_SOCKET.Port=4446
 



-- 
NeoMail - Webmail that doesn't suck... as much.
http://neomail.sourceforge.net

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

--
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: 




HierarchyEventListener (new logger event?)

2002-07-29 Thread Klein, Scott @ TW

I am working on a component that tracks modifications to the log4j
hierarchy, for a variety of reasons, and while the HierarchyEventListener
allows me to see when appenders are being added/removed I might also require
being notified when loggers are either being requested/delivered or
initially created.

>From looking at the code, it seems like a trivial addition:
1) add the appropriate methods to HierarchyEventListener interface
2) add fire* methods in the Hierarchy class
3) call the fire* methods at the appropriate time 
- in the getLogger(String name, LoggerFactory factory)
method of Hierarchy.

This will allow me to get rid of my current process which updates from the
Hierarchy at intervals.

This is the first "customization" that I require which must involve the
log4j code, which I obviously don't want to do. The only other way I can
think of doing this (without touching log4j code) is to create a new
appender which will fire updates when a logger is *used* - not very pretty.

Does anyone have an alternative solution that would not involve me keeping
up my own Log4J code (all 2 classes), or is this something that people might
want/need in later releases?



thanks
scott

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




RE: log4j programming question...

2002-07-18 Thread Klein, Scott @ TW

Why would you serialize a logger?

-Original Message-
From: Martin Gainty [mailto:[EMAIL PROTECTED]]
Sent: Thursday, July 18, 2002 2:45 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: log4j programming question...




Assuming the variable will never be serialised or deserialised..

-Martin 

>I usually add transient - just for good measure 
> 
>-Original Message- 
>From: Jacob Kjome [mailto:[EMAIL PROTECTED]] 
>Sent: Thursday, July 18, 2002 2:18 PM 
>To: Log4J Users List 
>Subject: Re: log4j programming question... 
> 
> 
>Can someone please comment on my question below? 
> 
>thanks, 
> 
>Jake 
> 
>Wednesday, July 17, 2002, 3:26:19 PM, you wrote: 
> 
>JK> Hi, 
> 
>JK> I have seen some cases where loggers are defined as "public", some as 
>JK> "protected", some as "private", and some as the default package level 
>JK> visibility. Along the same lines, I have seen cases where loggers are 
>JK> defined as "static" and others non-static. I have also seen some 
>JK> cases where the logger is defined as "final". 
> 
>JK> What would be the "best practice" here? Would it depend on the 
>JK> application? Is there an advantage for subclasses to have access to 
>JK> the parent class logger as those defined as "public" and "protected" 
>JK> would be visible to subclases? Shouldn't subclasses be using their 
>JK> own loggers? 
> 
>JK> I would think that the following would be the best practice: 
> 
>JK> final private static Logger logger = 
>Logger.getLogger{MyClass.class.getName()); 
> 
> 
>JK> Is this the case? I'm really just trying to get some validation here. 
>JK> Are there any disadvantages to the above? 
> 
>JK> Thanks, 
> 
>JK> Jake 
> 
> 
> 
> 
> 
> 
>-- 
>Best regards, 
> Jacob mailto:[EMAIL PROTECTED] 
> 
> 
>-- 
>To unsubscribe, e-mail: 
>For additional commands, e-mail: 
> 
>-- 
>To unsubscribe, e-mail: 
>For additional commands, e-mail: 

  _  

Send and receive Hotmail on your mobile device: Click
 Here





RE: log4j programming question...

2002-07-18 Thread Klein, Scott @ TW

I usually add transient - just for good measure

-Original Message-
From: Jacob Kjome [mailto:[EMAIL PROTECTED]]
Sent: Thursday, July 18, 2002 2:18 PM
To: Log4J Users List
Subject: Re: log4j programming question...


Can someone please comment on my question below?

thanks,

Jake

Wednesday, July 17, 2002, 3:26:19 PM, you wrote:

JK> Hi,

JK> I have seen some cases where loggers are defined as "public", some as
JK> "protected", some as "private", and some as the default package level
JK> visibility.  Along the same lines, I have seen cases where loggers are
JK> defined as "static" and others non-static.  I have also seen some
JK> cases where the logger is defined as "final".

JK> What would be the "best practice" here?  Would it depend on the
JK> application?  Is there an advantage for subclasses to have access to
JK> the parent class logger as those defined as "public" and "protected"
JK> would be visible to subclases?  Shouldn't subclasses be using their
JK> own loggers?

JK> I would think that the following would be the best practice:

JK> final private static Logger logger =
Logger.getLogger{MyClass.class.getName());


JK> Is this the case?  I'm really just trying to get some validation here.
JK> Are there any disadvantages to the above?

JK> Thanks,

JK> Jake

  




-- 
Best regards,
 Jacobmailto:[EMAIL PROTECTED]


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

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




NullAppender questions

2002-07-15 Thread Klein, Scott @ TW

I've been using the org.apache.log4j.varia.NullAppender and there is a minor
issue - the documentation suggests using the getInstance() method to
retrieve an instance of the class, which is fine except that the method is
not static

Also, when I do a CVS update, I can't find the varia.NullAppender source,
but there is (a different) one in the performance package ??? Which is the
'real' one?


On a similar topic, what is the proper way to turn logging 'off'  without
modifying/removing entire configurations (and/or changing code)?

thanks
scott

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




adding custom ObjectRenderer

2002-07-11 Thread Klein, Scott @ TW

After looking through the list archive I thought that I had found my answer,
but I must be missing a detail because the proper LoggingEvent messages
don't seem to be going through my ObjectRenderer:

I have tried to add my ObjectRenderer in my config.xml file:



and also programatically:

LoggerRepository rp = LogManager.getLoggerRepository();
if ( rp instanceof Hierarchy ) {
Hierarchy h = ( Hierarchy ) rp;
h.addRenderer( foo.NeedsCustomRenderer.class,
   new CustomRenderer() );
} else {
LogLog.error( "LoggerRepository is NOT a Hierarchy" );
}

In th first case I receive notice that the renderer info has at least been
noticed, and in the second I do not get the error output. However, when I
test my logging:

logger.error( new NeedsCustomRenderer() );

all I get in the log is the result of a toString() call.from the mail
archives, this seems to be all that is needed, although there have been some
posts with similar problems that have not been replied to. Am I missing
something here?



thanks
scott

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




RE: StaticHierarchy class?

2002-06-24 Thread Klein, Scott @ TW

Mark -

I appreciate your response. I will look into OptimizeIT - I am just not
familiar with doing profiling (other than just logical conclusions - like
the replies on this topic). Unfortunately, in my current situation there are
people who need "real convincing".

I am not in an embedded environment, so memory is not vital - but still
pretty important. I liked your comments about garbage collection (another
problem we run into time and again) and having static loggers.

I am off to do some profiling...

Also, I just wanted to thank Ceki, Yoav and Mark. I kind of got hammered
with some feedback at work late last week about this and tried to force the
issue in the newsgroup, for which I apologize. Thanks for your feedback and
help.

-Original Message-
From: Mark Womack [mailto:[EMAIL PROTECTED]]
Sent: Monday, June 24, 2002 9:23 AM
To: 'Log4J Users List'
Subject: RE: StaticHierarchy class?


Scott,

You can use a profiler tool to get a picture of what the memory usage is for
log4j related objects.  Something like OptimizeIt will do the trick if you
have it, or even the built-in profiler.

I have to echo Yoav and Ceki on this.  I looked at this in our servlet
container, and compared to everything else that is created, the log4j
objects are miniscule.  That may not be true in all environments as I
imagine that in an embedded system environment any and all memory usage
would be suspect (you aren't doing an embedded system are you?).  But once
most of your system is up and initialized, the percentage given to log4j
objects is very low, as you will see in the profiler data.

I think it also useful to point out that once you have most of your system
up, the log4j objects will not greatly contribute to forcing/incurring
garbage collections (another performance concern related to memory) as
almost all the logger objects will have already been created and static in
memory.  String creation for logged messages will create memory, but any
system you choose will most likely incur this as well.

-Mark

> -Original Message-----
> From: Klein, Scott @ TW [mailto:[EMAIL PROTECTED]]
> Sent: Monday, June 24, 2002 7:57 AM
> To: 'Log4J Users List'
> Subject: RE: StaticHierarchy class?
> 
> 
> Yoav -
> 
> Do you have some numbers to share for this? I'd love to tell 
> my bosses "Ceki
> and Yoav said so.", but I don't think they'd buy it without some hard
> numbers ;)
> 
> 
> thanks
> scott
> 
> -Original Message-
> From: Shapira, Yoav [mailto:[EMAIL PROTECTED]]
> Sent: Friday, June 21, 2002 1:20 PM
> To: Log4J Users List
> Subject: RE: StaticHierarchy class?
> 
> 
> Howdy,
> 
> >Why is saving memory not important?
> 
> Saving memory is important.  However, like Ceki said (I've 
> verified this
> using a profiler for our system), the Logger instances (even at 1 for
> each class) take so much less memory than your application 
> classes, that
> their memory footprint is insignificant.
> 
> And ultimately, IMHO memory is cheap and performance (speed) matters
> more than memory.  
> 
> Yoav Shapira
> Millennium ChemInformatics
> 
> --
> To unsubscribe, e-mail:   
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: 
> <mailto:[EMAIL PROTECTED]>
> 
> --
> To unsubscribe, e-mail:   
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: 
> <mailto:[EMAIL PROTECTED]>
> 

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




RE: StaticHierarchy class?

2002-06-24 Thread Klein, Scott @ TW

Yoav -

Do you have some numbers to share for this? I'd love to tell my bosses "Ceki
and Yoav said so.", but I don't think they'd buy it without some hard
numbers ;)


thanks
scott

-Original Message-
From: Shapira, Yoav [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 21, 2002 1:20 PM
To: Log4J Users List
Subject: RE: StaticHierarchy class?


Howdy,

>Why is saving memory not important?

Saving memory is important.  However, like Ceki said (I've verified this
using a profiler for our system), the Logger instances (even at 1 for
each class) take so much less memory than your application classes, that
their memory footprint is insignificant.

And ultimately, IMHO memory is cheap and performance (speed) matters
more than memory.  

Yoav Shapira
Millennium ChemInformatics

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

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




RE: StaticHierarchy class?

2002-06-21 Thread Klein, Scott @ TW

>Logger x1 = Logger.getLogger("x");
>Logger x2 = Logger.getLogger("x");
>
>Both x1 and x2 reference the exact same object.

Of course, but you lose the class level granularity for configurations.
Which is exactly what I would like to keep, and in order to do so you must
create loggers by class.

The issue is that if you have a configuration for "com.foo", then request a
logger with the class "com.foo.bar.FooBar" a new logger instance is created,
rather than using the "com.foo" logger. (just as a side note: the
interesting thing here is that it will have a configuration like "com.foo").

>Even if the saving in the memory footprint were important (which they are
not!)

Why is saving memory not important?

Can you give me some insight into how you would configure a system that
needs to be able to have each classes logger configurable while also being
able to keep the total number of loggers instantiated well below n, where n
is the total number of classes loaded in the system (and using Loggers).


thanks
scott

-Original Message-
From: Ceki Gülcü [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 21, 2002 12:40 PM
To: Log4J Users List
Subject: Re: StaticHierarchy class?



At 14:46 19.06.2002 -0700, Klein, Scott @ TW wrote:
>I'm full of questions/comments today...
>
>Has anyone worried about the amount of resources (primarily mem space)
>attributed to Log4J to the extent that there was a need for a
>"StaticHierarchy" whereby, if a user requests a Logger that does not exist
>it will NOT be created. Basically, they have to be listed in the config
>file.
>
>A little strict - but I was thinking a step further where if
>com.foo.bar.FooBar asks for a Logger using getLogger( this.getClass() )
>then a non-Null (or non-Root!) logger is returned iff:
>+ there is a predefined logger for com.foo.bar.FooBar
>OR
>+ there is a predefined logger for com, or com.foo, or com.foo.bar - but in
>this case the logger returned is NOT a newly instantiated one, but the
>corresponding logger to the match as if they had called getLogger(
"com.foo"
>) for example (if that makes sense).

Logger x1 = Logger.getLogger("x");
Logger x2 = Logger.getLogger("x");

Both x1 and x2 reference the exact same object.

>Basically, the constraint is that if the class does not have a logger
>defined for it, or the class is contained in a package that does not have a
>logger defined for it, or its super-packages, then the root logger is
>returned. Otherwise, the deepest logger in the hierarchy along the path to
>the requestor is returned. You lose flexibility (you can't have people
>making changes to the Logger they get), but you save resources.
>
>Not sure if all that makes sense, but my primary concern is if I have 100
>classes that ask: Logger.getLogger(this.getClass()) then I am going to be
>carrying 100 instances of Logger around (guaranteed).

Even if all your 100 classes used the root logger the gains in
the memory footprint would be negligible compared to the memory foot
print of your 100 classes.  Even if the saving in the memory footprint
were important (which they are not!)  the list of configured loggers
can change during the execution of the program but an already assigned
logger cannot shed its skin and automatically assume another identity.

>Any thoughts or comments on if/why/how this might accomplished?

Yes, one comment: don't tune what you don't need to tune.

Here is one of my favorite quotes:

   Have lots of ideas and throw away the bad ones. You aren't going to
   have good ideas unless you have lots of ideas and some sort of
   principle of selection.

   -- Linus Pauling (the only person to win two unshared Nobel Prizes)


>thanks
>s

--
Ceki


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




RE: How do you handle Logger hierarchy?

2002-06-20 Thread Klein, Scott @ TW

It seems like the configurations for the logger returned _are_ correct
though. For instance:






class foo.bar.foobar.Foo:
Logger logger = Logger.getLogger( this.getClass() );
this returns a new logger named "foo.bar.foobar.Foo", BUT it is configured
to append to the XMLFILE properly.

Why is this the case?


-Original Message-
From: Ceki Gülcü [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 20, 2002 1:39 AM
To: Log4J Users List
Subject: Re: How do you handle Logger hierarchy?



Loger.getLogger(Class x) will always return the logger named
x.getName(). If you observe anything else it's a bug. If you
send a bug report reproducing this bug, the beer is on me. Asking you
to reciprocate would be unfair. :-)

At 23:03 19.06.2002 -0400, you wrote:
> From some of my debugging sessions, it appears that 
> Logger.getLogger(Class) will get the logger nearest the root that matches 
> the FQCN.  In many of my debugging sessions, I only specified the root 
> logger, and I got it for all of my Logger calls.
>
>I'm sure someone will correct me if I've mis-interpreted what I saw. :^)
>
>-
>Cheers,
>Mike McAngus
>[EMAIL PROTECTED]

--
Ceki


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

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




Internationalization/ResourceBundles in messages?

2002-06-13 Thread Klein, Scott @ TW

Has anyone implemented internationalized messages with Log4J? I noticed that
Suns interface allows you to set ResourceBundles.

Let me first say that I am a little out of my depth with the int'l/bundle
stuff, but I've gotten lots of questions about it presenting Log4J as our
solution, so I thought I'd get an answer for "them" here.

Any experiences, how-to's or 'next release' type answers would be greatly
appreciated.


-scott

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




RE: JDBCAppender problem

2002-06-12 Thread Klein, Scott @ TW

have you tried 'Sql' as the parameter name? Getting into the statement get a
little touchy with PatternSets and stuff - you may want to just extend it.

Disclaimer: I have not used JDBCAppender

>From the Javadoc:
The setSql(String sql) sets the SQL statement to be used for logging -- this
statement is sent to a PatternLayout (either created automaticly by the
appender or added by the user). Therefore by default all the conversion
patterns in PatternLayout can be used inside of the statement. (see the test
cases for examples) 

Overriding the getLogStatement(org.apache.log4j.spi.LoggingEvent) method
allows more explicit control of the statement used for logging

-Original Message-
From: Jyothi Panduranga [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 12, 2002 10:59 AM
To: Log4J Users List
Subject: RE: JDBCAppender problem


Thanks for your reply.  I got myself mixed up with the Kevin Steppe's
JDBCAppender with the Thomas Fenner's configuration file.  But still I
cannot find anywhere about the parameter name for the SQL statement in
the configuration file.  Can I specify SQL statement in the
configuration file? If not, How do I specify it?

Thanks again,
Jyothi

-Original Message-----
From: Klein, Scott @ TW [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 12, 2002 10:53 AM
To: 'Log4J Users List'
Subject: RE: JDBCAppender problem



BufferSize, db URL, User, & Password are the parameter names -
capitalization counts

log4j.appender.JDBC=org.apache.log4j.jdbc.JDBCAppender
log4j.appender.JDBC.URL=jdbc:odbc:pinjyothi
log4j.appender.JDBC.User=pinjyothi
log4j.appender.JDBC.Password=jyothi
log4j.appender.JDBC.BufferSize=1

-- I don't know what this is, its not listed as a parameter, but you
might
try 'true' 
log4j.appender.JDBC.commit=Y

-Original Message-
From: Jyothi Panduranga [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 12, 2002 10:47 AM
To: [EMAIL PROTECTED]
Subject: FW: JDBCAppender problem


Oops.. Here is the 'sort1.lcf' file

 <> 
Jyothi

>  -Original Message-
> From: Jyothi Panduranga  
> Sent: Wednesday, June 12, 2002 10:45 AM
> To:   '[EMAIL PROTECTED]'
> Subject:  JDBCAppender problem
> 
> Hi,
> 
>   I am trying to run the example program 'Sort' with some modification
> to 'sort1.lcf' file.  I have attached the 'sort1.lcf' file.  I trying
> to write the log to SQL database.  I am getting this following error
> when I ran 'Sort' program. Can anybody please tell me what I need to
> do to fix this problem. I am new to log4j.  
> 
> 
> log4j:WARN No such property [username] in
> org.apache.log4j.jdbc.JDBCAppender.
> log4j:WARN No such property [buffer] in
> org.apache.log4j.jdbc.JDBCAppender.
> log4j:WARN No such property [commit] in
> org.apache.log4j.jdbc.JDBCAppender.
> log4j:WARN No such property [url] in
> org.apache.log4j.jdbc.JDBCAppender.
> log4j:ERROR Failed to excute sql
> java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source
> name not found and no default driver specified
> at
> sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6031)
> at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:6188)
> at sun.jdbc.odbc.JdbcOdbc.SQLDriverConnect(JdbcOdbc.java:2458)
> at
> sun.jdbc.odbc.JdbcOdbcConnection.initialize(JdbcOdbcConnection.java:32
> 0)
> at
> sun.jdbc.odbc.JdbcOdbcDriver.connect(JdbcOdbcDriver.java:163)
> at
> java.sql.DriverManager.getConnection(DriverManager.java:517)
> at
> java.sql.DriverManager.getConnection(DriverManager.java:177)
> at
> org.apache.log4j.jdbc.JDBCAppender.getConnection(JDBCAppender.java:192
> )
> at
> org.apache.log4j.jdbc.JDBCAppender.execute(JDBCAppender.java:155)
> at
> org.apache.log4j.jdbc.JDBCAppender.flushBuffer(JDBCAppender.java:230)
> at
> org.apache.log4j.jdbc.JDBCAppender.append(JDBCAppender.java:126)
> at
> org.apache.log4j.AppenderSkeleton.doAppend(AppenderSkeleton.java:222)
> at
> org.apache.log4j.helpers.AppenderAttachableImpl.appendLoopOnAppenders(
> AppenderAttachableImpl.java:5
> 7)
> at org.apache.log4j.Category.callAppenders(Category.java:190)
> at org.apache.log4j.Category.forcedLog(Category.java:375)
> at org.apache.log4j.Category.info(Category.java:678)
> at examples.Sort.main(Sort.java:54)
> 
> Thanks,
> Jyothi

--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




RE: JDBCAppender problem

2002-06-12 Thread Klein, Scott @ TW


BufferSize, db URL, User, & Password are the parameter names -
capitalization counts

log4j.appender.JDBC=org.apache.log4j.jdbc.JDBCAppender
log4j.appender.JDBC.URL=jdbc:odbc:pinjyothi
log4j.appender.JDBC.User=pinjyothi
log4j.appender.JDBC.Password=jyothi
log4j.appender.JDBC.BufferSize=1

-- I don't know what this is, its not listed as a parameter, but you might
try 'true' 
log4j.appender.JDBC.commit=Y

-Original Message-
From: Jyothi Panduranga [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 12, 2002 10:47 AM
To: [EMAIL PROTECTED]
Subject: FW: JDBCAppender problem


Oops.. Here is the 'sort1.lcf' file

 <> 
Jyothi

>  -Original Message-
> From: Jyothi Panduranga  
> Sent: Wednesday, June 12, 2002 10:45 AM
> To:   '[EMAIL PROTECTED]'
> Subject:  JDBCAppender problem
> 
> Hi,
> 
>   I am trying to run the example program 'Sort' with some modification
> to 'sort1.lcf' file.  I have attached the 'sort1.lcf' file.  I trying
> to write the log to SQL database.  I am getting this following error
> when I ran 'Sort' program. Can anybody please tell me what I need to
> do to fix this problem. I am new to log4j.  
> 
> 
> log4j:WARN No such property [username] in
> org.apache.log4j.jdbc.JDBCAppender.
> log4j:WARN No such property [buffer] in
> org.apache.log4j.jdbc.JDBCAppender.
> log4j:WARN No such property [commit] in
> org.apache.log4j.jdbc.JDBCAppender.
> log4j:WARN No such property [url] in
> org.apache.log4j.jdbc.JDBCAppender.
> log4j:ERROR Failed to excute sql
> java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source
> name not found and no default driver specified
> at
> sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6031)
> at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:6188)
> at sun.jdbc.odbc.JdbcOdbc.SQLDriverConnect(JdbcOdbc.java:2458)
> at
> sun.jdbc.odbc.JdbcOdbcConnection.initialize(JdbcOdbcConnection.java:32
> 0)
> at
> sun.jdbc.odbc.JdbcOdbcDriver.connect(JdbcOdbcDriver.java:163)
> at
> java.sql.DriverManager.getConnection(DriverManager.java:517)
> at
> java.sql.DriverManager.getConnection(DriverManager.java:177)
> at
> org.apache.log4j.jdbc.JDBCAppender.getConnection(JDBCAppender.java:192
> )
> at
> org.apache.log4j.jdbc.JDBCAppender.execute(JDBCAppender.java:155)
> at
> org.apache.log4j.jdbc.JDBCAppender.flushBuffer(JDBCAppender.java:230)
> at
> org.apache.log4j.jdbc.JDBCAppender.append(JDBCAppender.java:126)
> at
> org.apache.log4j.AppenderSkeleton.doAppend(AppenderSkeleton.java:222)
> at
> org.apache.log4j.helpers.AppenderAttachableImpl.appendLoopOnAppenders(
> AppenderAttachableImpl.java:5
> 7)
> at org.apache.log4j.Category.callAppenders(Category.java:190)
> at org.apache.log4j.Category.forcedLog(Category.java:375)
> at org.apache.log4j.Category.info(Category.java:678)
> at examples.Sort.main(Sort.java:54)
> 
> Thanks,
> Jyothi

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




RE: getClassName from locationInfo object

2002-06-12 Thread Klein, Scott @ TW

well, you are correct. I hadn't bothered to look in depth once I got mine
working ;)

The setLocationInfo() seems only to be in Async, JMS, Socket(Hub) and SMTP
appenders...as well as XML and HTML layouts. Since you don't use any of
those...sorry.

I honestly don't know enough about how and when the LocationInfo is created
to tell you whether extending JDBCAppender would help - that would assume
that the LoggingEvent already has the info, and the Appender is just
ignoring it. God help you if you have to get into the PatternParser stuff ;)

I'll just throw this out there seeing as it may be the quickest way to
handle the problem - extend JDBCAppender yourself and just over-ride
getLogStatement()





-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 12, 2002 8:15 AM
To: Log4J Users List
Subject: RE: getClassName from locationInfo object



Okay, sounds good.  Is "locationInfo" a field in log4j somewhere?  The
JDBCAppender extends the AppenderSkeleton class, which doesn't seem to have
a locationInfo method.  I can add the field, but how does log4j pick that
up?  Is the JMX smart enough to do that?

Thanks,
Steve



 

  "Klein, Scott @

  TW"   
   cc:

  06/12/2002 10:37 Subject:  RE: getClassName
from locationInfo object   
  AM

  Please respond to

  "Log4J Users

  List"

 

 





The recommendation to not us %C is purely a speed issue as far as I know. I
also had a similar problem, and here is what fixed it:

log4j.appender..locationInfo=true

where  is, well, the name of the appender ;)

enjoy.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 12, 2002 5:19 AM
To: Log4J Users List
Subject: RE: getClassName from locationInfo object



Well, I'm extending the JDBCAppender to use its own thread, and to use a
prepared statement, so I have my own columns for classname, etc.  I'm using
(in development)  Win 2000 and WebLogic 6.1.  I'm going to try to put some
log4j calls in actual classes (not JSPs) and see if it can pick it up.

Why is it not recommended to use %C in the pattern?  Does it slow things
down too much?

Thanks!
Steve





  "RUTHERFURD,

  Michael" To:   Log4J Users List
<[EMAIL PROTECTED]>
Subject:  RE: getClassName
from locationInfo object


  06/11/2002 09:49

  PM

  Please respond to

  "Log4J Users

  List"









The ? probably means that LocationInfo couldn't parse the Throwable's stack
trace that is used to determine class name, method name, line number etc.
What OS are you using, as I had this problem in Websphere on AS400? I ended
up having to write a kludged version of LocationInfo to parse the weird
stack trace.

Anyway its not recommended that you use %C in the pattern. Maybe you can
can
use %c if the category name is the same as the class.

Michael Rutherfurd

> I'm using log4j within my JSPs, and I'd like to log the class name, etc
in
> my message, but all I get for the class name is ?.  Is this some
limitations on JSPs, > or is there something I'm missing?  I looked through
> the archive to see if there was anything similar, but I didn't find
> anything.

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]
>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]
>



--

 NOTICE:  This e-mail message and all attachments transmitted with it may
 contain legally privileged and confidential information intended solely
 for the use of the addressee.  If the reader of this message is not the
 intended recipient, you are hereby notified that any reading,
 dissemination, distribution, copying, or other use of this message or
 its attachments, hyperlinks, or any other files of any kind is strictly
 prohibited.  If you have received this message in error, please notify
 the sender immediately by telephone (865-218-2000) or by a reply to this
 electronic mail message and delete this message and all copies and
 backups thereof.





--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]
>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]
>

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]
>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]
>



--
  
 NOTICE:  This e-mail message and all attachments transmitted with it may 
 contain legally privileged and co

RE: getClassName from locationInfo object

2002-06-12 Thread Klein, Scott @ TW

The recommendation to not us %C is purely a speed issue as far as I know. I
also had a similar problem, and here is what fixed it:

log4j.appender..locationInfo=true

where  is, well, the name of the appender ;)

enjoy.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 12, 2002 5:19 AM
To: Log4J Users List
Subject: RE: getClassName from locationInfo object



Well, I'm extending the JDBCAppender to use its own thread, and to use a
prepared statement, so I have my own columns for classname, etc.  I'm using
(in development)  Win 2000 and WebLogic 6.1.  I'm going to try to put some
log4j calls in actual classes (not JSPs) and see if it can pick it up.

Why is it not recommended to use %C in the pattern?  Does it slow things
down too much?

Thanks!
Steve



 

  "RUTHERFURD,

  Michael" To:   Log4J Users List
<[EMAIL PROTECTED]>
Subject:  RE: getClassName
from locationInfo object   
 

  06/11/2002 09:49

  PM

  Please respond to

  "Log4J Users

  List"

 

 





The ? probably means that LocationInfo couldn't parse the Throwable's stack
trace that is used to determine class name, method name, line number etc.
What OS are you using, as I had this problem in Websphere on AS400? I ended
up having to write a kludged version of LocationInfo to parse the weird
stack trace.

Anyway its not recommended that you use %C in the pattern. Maybe you can
can
use %c if the category name is the same as the class.

Michael Rutherfurd

> I'm using log4j within my JSPs, and I'd like to log the class name, etc
in
> my message, but all I get for the class name is ?.  Is this some
limitations on JSPs, > or is there something I'm missing?  I looked through
> the archive to see if there was anything similar, but I didn't find
> anything.

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



--
  
 NOTICE:  This e-mail message and all attachments transmitted with it may 
 contain legally privileged and confidential information intended solely  
 for the use of the addressee.  If the reader of this message is not the  
 intended recipient, you are hereby notified that any reading,
 dissemination, distribution, copying, or other use of this message or
 its attachments, hyperlinks, or any other files of any kind is strictly  
 prohibited.  If you have received this message in error, please notify   
 the sender immediately by telephone (865-218-2000) or by a reply to this 
 electronic mail message and delete this message and all copies and   
 backups thereof. 
  




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

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




RE: Level comparator?

2002-06-07 Thread Klein, Scott @ TW

oops.

i didn't mean cast - i guess i meant without using the Priority class (since
this will be gone soon, right?) - or when it's removed will these methods be
moved up to Level?

-Original Message-----
From: Klein, Scott @ TW [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 07, 2002 12:37 PM
To: Log4J-User (E-mail)
Subject: Level comparator?


I was just curious if there was a reason Level doesn't implement the
Comparator interface...rather than having to do toInt()'s or cast them down
to Priority's


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




Level comparator?

2002-06-07 Thread Klein, Scott @ TW

I was just curious if there was a reason Level doesn't implement the
Comparator interface...rather than having to do toInt()'s or cast them down
to Priority's


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




Filters and configuration

2002-06-07 Thread Klein, Scott @ TW

Are filters meant only to be added programatically, or can they also be
added in the configuration file? I have not seen mention of them in any
sample config files I have seen so I am assuming they must be added
programtically - however, the appenders (I assume) use a LevelRangeFilter by
default but this is not set by anything like:

log4j.appender.MyAppender.filter=MyFirstFilter
log4j.appender.MyAppender.filter=MySecondFilter

log4j.filter.MyFirstFilter=com.foo.MyFirstFilter
log4j.filter.MyFirstFilter.attribute1=value1
log4j.filter.MySecondFilter=com.foo.MySecondFilter
log4j.filter.MySecondFilter.attribute2=value2

which would be my first inclination

___
Scott Klein 

L-3 Communications
Telemetry-West
9020 Balboa Avenue
San Diego, CA  92123-3507

858.694.7787
[EMAIL PROTECTED]





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




RE: config log4j to print to console from applet and logfile from servlet --- Please HELP!

2002-06-07 Thread Klein, Scott @ TW

As for documentation, I have been using Vipan Singla's "Don't Use
System.out.println..." which is under the documentation link. It is rather
out-of-date, but the basics for config files are there. I also use the
Javadoc for setting parmeters (look for the bold names). Of course, any and
all of the documents are good to at least browse. If you have specific
questions, ask them here.

As for multiple log files, that is easy enough - keep in mind this is for
logging in separate JVM's (ie Client/Server) situations, like yours [I have
thought about, but not looked into loading multiple log configurations in a
single JVM].

All I do is have the following line of code in my 'start-up' class:

Properties props = //load properties from file
PropertyConfigurator.configure( props );

Since you have an applet and a servlet, each of those classes (or, perhaps
instead of the servlet have the servlet engine do it) load up a
configuration.

The main idea here is that you do not have a single application with an
Applet and a Servlet. You have an Applet 'application' and a Servlet
'application' - so it makes sense that their configurations should be
separate.

I hope that makes sense...

-Original Message-
From: Daling Xu [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 07, 2002 9:43 AM
To: Log4J Users List
Subject: RE: config log4j to print to console from applet and logfile
from servlet --- Please HELP!


Hi, All

Thank you very much for the reply.

Could you explain a little detail how to have multiple config file? I am an
absolutly beginner on  this topic, only know to use log4j.properties, the
default config file, now. Could you point out some links of manual for
log4j. I heard of there is a detail manul for log4j, but I can't find it in
jakarta.apache.org's log4j site.

Thanks.

Daling

-Original Message-
From: Klein, Scott @ TW [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 06, 2002 6:11 PM
To: 'Log4J Users List'
Subject: RE: config log4j to print to console from applet and logfile
from servlet --- Please HELP!


Well, I have been mucking around in the config files so here is my
observation:


log4j.logger.servlet.Register=DEBUG, dest1
log4j.logger.applet.myApplet=DEBUG, dest2


the only thing that changed in the last version was the addition of the
appenders. And since dest2 is definitely NOT causing any problems, it has to
be the dest1 entry...

I think the problem is that when you specify an Appender it will create it
for you - and if this config file is used in an Applet then, of course,
there are going to be problems opening the file (without permission, that
is). So, have a config file for your server and a seperate one that gets
deployed with your applet (which makes sense anyway, right?)

hope that helps (and works)

-Original Message-
From: Daling Xu [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 06, 2002 2:58 PM
To: Log4J Users List
Subject: config log4j to print to console from applet and logfile from
servlet --- Please HELP!


Hi, All

I posted a message here two days ago, but nobody replied :(
Please take a look at this, any help will be warmly appreciated.

I am considering using log4j in my project, which is a web-application. I
used
j2sdk1.4, servlet 2.3 , java plug in 1.4, and log4j 1.2.3.  When I use log4j
to log informations in the jsp or servlet, every thing is fine, I can write
to both the console or a file in the server side.

Here is the log4j.properties I used, you can notice I configed two servlets
to log into different  destinations: console and file. It works.

log4j.rootLogger=FATAL, dest2
log4j.logger.servlet.UserLogin=FATAL
log4j.logger.servlet.Register=DEBUG, dest1

log4j.appender.dest1=org.apache.log4j.RollingFileAppender
log4j.appender.dest1.File=logExample.log
log4j.appender.dest1.MaxFileSize=100KB
log4j.appender.dest1.MaxBackupIndex=1
log4j.appender.dest1.layout=org.apache.log4j.PatternLayout

log4j.appender.dest2=org.apache.log4j.ConsoleAppender
log4j.appender.dest2.layout=org.apache.log4j.PatternLayout

Then I added an applet into my project and try to use logger in it also. If
I use the following log4j.prpoerties, it also works well, I can print to
console from both applet and servlet.

#every logger log to console
log4j.rootLogger=FATAL, dest2
log4j.logger.servlet.UserLogin=FATAL
log4j.logger.servlet.Register=DEBUG
log4j.logger.applet.myApplet=DEBUG

log4j.appender.dest1=org.apache.log4j.RollingFileAppender
log4j.appender.dest1.File=logExample.log
log4j.appender.dest1.MaxFileSize=100KB
log4j.appender.dest1.MaxBackupIndex=1
log4j.appender.dest1.layout=org.apache.log4j.PatternLayout

log4j.appender.dest2=org.apache.log4j.ConsoleAppender
log4j.appender.dest2.layout=org.apache.log4j.PatternLayout

But, I still want the logger to write to a file, because I can't access the
console of our deployed server. So I changed the log4j.properties to:

log4j.rootLogger=FATAL

RE: config log4j to print to console from applet and logfile from servlet --- Please HELP!

2002-06-06 Thread Klein, Scott @ TW

Well, I have been mucking around in the config files so here is my
observation:


log4j.logger.servlet.Register=DEBUG, dest1
log4j.logger.applet.myApplet=DEBUG, dest2


the only thing that changed in the last version was the addition of the
appenders. And since dest2 is definitely NOT causing any problems, it has to
be the dest1 entry...

I think the problem is that when you specify an Appender it will create it
for you - and if this config file is used in an Applet then, of course,
there are going to be problems opening the file (without permission, that
is). So, have a config file for your server and a seperate one that gets
deployed with your applet (which makes sense anyway, right?)

hope that helps (and works)

-Original Message-
From: Daling Xu [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 06, 2002 2:58 PM
To: Log4J Users List
Subject: config log4j to print to console from applet and logfile from
servlet --- Please HELP!


Hi, All

I posted a message here two days ago, but nobody replied :(
Please take a look at this, any help will be warmly appreciated.

I am considering using log4j in my project, which is a web-application. I
used
j2sdk1.4, servlet 2.3 , java plug in 1.4, and log4j 1.2.3.  When I use log4j
to log informations in the jsp or servlet, every thing is fine, I can write
to both the console or a file in the server side.

Here is the log4j.properties I used, you can notice I configed two servlets
to log into different  destinations: console and file. It works.

log4j.rootLogger=FATAL, dest2
log4j.logger.servlet.UserLogin=FATAL
log4j.logger.servlet.Register=DEBUG, dest1

log4j.appender.dest1=org.apache.log4j.RollingFileAppender
log4j.appender.dest1.File=logExample.log
log4j.appender.dest1.MaxFileSize=100KB
log4j.appender.dest1.MaxBackupIndex=1
log4j.appender.dest1.layout=org.apache.log4j.PatternLayout

log4j.appender.dest2=org.apache.log4j.ConsoleAppender
log4j.appender.dest2.layout=org.apache.log4j.PatternLayout

Then I added an applet into my project and try to use logger in it also. If
I use the following log4j.prpoerties, it also works well, I can print to
console from both applet and servlet.

#every logger log to console
log4j.rootLogger=FATAL, dest2
log4j.logger.servlet.UserLogin=FATAL
log4j.logger.servlet.Register=DEBUG
log4j.logger.applet.myApplet=DEBUG

log4j.appender.dest1=org.apache.log4j.RollingFileAppender
log4j.appender.dest1.File=logExample.log
log4j.appender.dest1.MaxFileSize=100KB
log4j.appender.dest1.MaxBackupIndex=1
log4j.appender.dest1.layout=org.apache.log4j.PatternLayout

log4j.appender.dest2=org.apache.log4j.ConsoleAppender
log4j.appender.dest2.layout=org.apache.log4j.PatternLayout

But, I still want the logger to write to a file, because I can't access the
console of our deployed server. So I changed the log4j.properties to:

log4j.rootLogger=FATAL, dest2
log4j.logger.servlet.UserLogin=FATAL
#set servlet Register log to a file
log4j.logger.servlet.Register=DEBUG, dest1
log4j.logger.applet.myApplet=DEBUG, dest2

log4j.appender.dest1=org.apache.log4j.RollingFileAppender
log4j.appender.dest1.File=logExample.log
log4j.appender.dest1.MaxFileSize=100KB
log4j.appender.dest1.MaxBackupIndex=1
log4j.appender.dest1.layout=org.apache.log4j.PatternLayout

log4j.appender.dest2=org.apache.log4j.ConsoleAppender
log4j.appender.dest2.layout=org.apache.log4j.PatternLayout

Now, there is a java.security.AccessControlException, the exception
information is attached at end of this mail.

Is this a bug? How can I fix it?

I understand that in the applet I can't write to a file in the server side.
But I still want to have the flexibility to log to the file from the
servlet. Now it looks that I can only log to console if I want the applet
also use log4j.

Here is the error message from the applet:

java.lang.ExceptionInInitializerError

at org.apache.log4j.Category.getInstance(Category.java:517)

at
com.myCompany.myProject.myPackage.myApplet.(myApplet.java:84)

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown
Source)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown
Source)

at java.lang.reflect.Constructor.newInstance(Unknown Source)

at java.lang.Class.newInstance0(Unknown Source)

at java.lang.Class.newInstance(Unknown Source)

at sun.applet.AppletPanel.createApplet(Unknown Source)

at sun.plugin.AppletViewer.createApplet(Unknown Source)

at sun.applet.AppletPanel.runLoader(Unknown Source)

at sun.applet.AppletPanel.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)

Caused by: java.security.AccessControlException: access denied
(java.io.FilePermission logFile.log write)

at java.security.AccessControlContext.checkPermission(Unknown
Source)

at java.security.AccessController.checkPermission(Unknown Source)

at java.lang.SecurityManag

RE: package level Logger configuration?

2002-06-06 Thread Klein, Scott @ TW

Mark -

I had tried it, but I must have missed something because the second before
your reply arrived I tried again and had it working ;)  Doh!

thanks!

-Original Message-
From: Mark Womack [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 06, 2002 10:59 AM
To: 'Log4J Users List'
Subject: RE: package level Logger configuration?


Scott,

Have you tried it?  Yes, it should work as you expect, and I think your
syntax is fine, but then I don't use the PropertyConfigurator.  In XML it
would look like:



  



  


or something like that.  I use this quite often to set the level for all the
classes within a given package and then I set the level for individual
classes within that package as needed.  So, adding another configuration:





hope it helps,
-Mark


> -Original Message-----
> From: Klein, Scott @ TW [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, June 06, 2002 10:13 AM
> To: Log4J-User (E-mail)
> Subject: package level Logger configuration?
> 
> 
> I must not be looking in the right place, but from reading 
> the documentation
> it appears that the following is possible:
> 
> log4j.logger.=DEBUG, A1
> log4j.logger.=FATAL, A1
> (assume  and  do not overlap for
> simplicity sake)
> 
> where, all of the classes under  will use the first
> configuration and the classes under  
> will use the
> second - rather than having to list each class separately 
> (and I don't want
> them to inheirit the root loggers config - i.e. additivity is false)
> 
> in other words, if i have a class:
> 
> package ;
> 
> public class AClass {
> Logger logger = Logger.getLogger( this.getClass() );
> }
> 
> then it would look get a logger with the first configuration.
> 
> So, my question is - (1) is that true - and possible?,  (2) 
> what is the
> proper syntax in the configuration file?
> 
> Also, it must be in a configuration file ... I know how much 
> everyone likes
> to do it programatically, but I cannot.
> 
> 
> thanks
> scott
> 
> --
> To unsubscribe, e-mail:   
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




package level Logger configuration?

2002-06-06 Thread Klein, Scott @ TW

I must not be looking in the right place, but from reading the documentation
it appears that the following is possible:

log4j.logger.=DEBUG, A1
log4j.logger.=FATAL, A1
(assume  and  do not overlap for
simplicity sake)

where, all of the classes under  will use the first
configuration and the classes under  will use the
second - rather than having to list each class separately (and I don't want
them to inheirit the root loggers config - i.e. additivity is false)

in other words, if i have a class:

package ;

public class AClass {
Logger logger = Logger.getLogger( this.getClass() );
}

then it would look get a logger with the first configuration.

So, my question is - (1) is that true - and possible?,  (2) what is the
proper syntax in the configuration file?

Also, it must be in a configuration file ... I know how much everyone likes
to do it programatically, but I cannot.


thanks
scott

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




RE: JTableAppender anyone?

2002-06-05 Thread Klein, Scott @ TW

ah! didn't see that.

thanks.

-Original Message-
From: Robert Hedin [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 05, 2002 2:57 PM
To: Log4J Users List
Subject: Re: JTableAppender anyone?


not a big deal but I believe LF5 was donated to apache.
checkout the src for log4j: package org.apache.log4j.lf5

rob.

- Original Message -
From: "Klein, Scott @ TW" <[EMAIL PROTECTED]>
To: "'Log4J Users List'" <[EMAIL PROTECTED]>
Sent: Wednesday, June 05, 2002 5:54 PM
Subject: RE: JTableAppender anyone?


> Ceki -
>
> just looked at chainsaw, which does what my first inclination was ... just
> have a socketnode notify the table(model) -- as for LF5 I decompiled a few
> classes and found some classes that extend SkeletonAppender, but I really
> don't want to (can't) decompile commercial code and use it in my
project...
>
>
>
> -Original Message-
> From: Ceki Gülcü [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, June 05, 2002 2:35 PM
> To: Log4J Users List
> Subject: RE: JTableAppender anyone?
>
>
>
> Err.. How about chainsaw or LF5?
>
> At 16:21 05.06.2002 -0500, you wrote:
> >There is one already. Look under contribs/CekiGulcu.
> >
> >Michael
> >
> >-Original Message-
> >From: Klein, Scott @ TW [mailto:[EMAIL PROTECTED]]
> >Sent: Wednesday, June 05, 2002 4:10 PM
> >To: Log4J-User (E-mail)
> >Subject: JTableAppender anyone?
> >
> >
> >I was curious if anyone out there knows of an Appender extension for
> >JTable's?
> >
> >I've looked into LumberMill, but they don't seem to have a specific
> Appender
> >class for it. Am I wrong to think that this would be fairly easy to do,
and
> >also extremely useful? LumberMill has their own TableModel (which is fine
I
> >guess), but wouldn't you *want* a customized Appender for this.
> >
> >The way I view it (and I may be wrong) is if you change the
JTableAppender
> >configuration then the JTable view (columns, etc) would change as well...
> >
> >Any input/advice/thoughts would be appreciated.
> >
> >
> >
> >scott
>
> --
> Ceki
>
> SUICIDE BOMBING - A CRIME AGAINST HUMANITY
> Sign the petition: http://www.petitiononline.com/1234567b
> I am signatory number 22106. What is your number?
>
>
> --
> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
>
> --
> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




RE: JTableAppender anyone?

2002-06-05 Thread Klein, Scott @ TW

Ceki -

just looked at chainsaw, which does what my first inclination was ... just
have a socketnode notify the table(model) -- as for LF5 I decompiled a few
classes and found some classes that extend SkeletonAppender, but I really
don't want to (can't) decompile commercial code and use it in my project...



-Original Message-
From: Ceki Gülcü [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 05, 2002 2:35 PM
To: Log4J Users List
Subject: RE: JTableAppender anyone?



Err.. How about chainsaw or LF5?

At 16:21 05.06.2002 -0500, you wrote:
>There is one already. Look under contribs/CekiGulcu.
>
>Michael
>
>-Original Message-----
>From: Klein, Scott @ TW [mailto:[EMAIL PROTECTED]]
>Sent: Wednesday, June 05, 2002 4:10 PM
>To: Log4J-User (E-mail)
>Subject: JTableAppender anyone?
>
>
>I was curious if anyone out there knows of an Appender extension for
>JTable's?
>
>I've looked into LumberMill, but they don't seem to have a specific
Appender
>class for it. Am I wrong to think that this would be fairly easy to do, and
>also extremely useful? LumberMill has their own TableModel (which is fine I
>guess), but wouldn't you *want* a customized Appender for this.
>
>The way I view it (and I may be wrong) is if you change the JTableAppender
>configuration then the JTable view (columns, etc) would change as well...
>
>Any input/advice/thoughts would be appreciated.
>
>
>
>scott

--
Ceki

SUICIDE BOMBING - A CRIME AGAINST HUMANITY
Sign the petition: http://www.petitiononline.com/1234567b
I am signatory number 22106. What is your number?


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




RE: JTableAppender anyone?

2002-06-05 Thread Klein, Scott @ TW

Michael -

Yes, I've just looked at that one, and previously looked at SvenReimers as
well. But, well, I was looking more for one that would compile ;) Oh, and
had a class involved that implemented Appender...unless I'm missing
something ?





-Original Message-
From: Michael Roytman [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 05, 2002 2:22 PM
To: 'Log4J Users List'
Subject: RE: JTableAppender anyone?


There is one already. Look under contribs/CekiGulcu.

Michael

-Original Message-
From: Klein, Scott @ TW [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 05, 2002 4:10 PM
To: Log4J-User (E-mail)
Subject: JTableAppender anyone?


I was curious if anyone out there knows of an Appender extension for
JTable's?

I've looked into LumberMill, but they don't seem to have a specific Appender
class for it. Am I wrong to think that this would be fairly easy to do, and
also extremely useful? LumberMill has their own TableModel (which is fine I
guess), but wouldn't you *want* a customized Appender for this.

The way I view it (and I may be wrong) is if you change the JTableAppender
configuration then the JTable view (columns, etc) would change as well...

Any input/advice/thoughts would be appreciated.



scott

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




JTableAppender anyone?

2002-06-05 Thread Klein, Scott @ TW

I was curious if anyone out there knows of an Appender extension for
JTable's?

I've looked into LumberMill, but they don't seem to have a specific Appender
class for it. Am I wrong to think that this would be fairly easy to do, and
also extremely useful? LumberMill has their own TableModel (which is fine I
guess), but wouldn't you *want* a customized Appender for this.

The way I view it (and I may be wrong) is if you change the JTableAppender
configuration then the JTable view (columns, etc) would change as well...

Any input/advice/thoughts would be appreciated.



scott

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




RE: SocketAppender and LoggingEvent data

2002-06-04 Thread Klein, Scott @ TW

Mark,

so, if i do:

log4j.appender.SOCKET.locationInfo=true

then the location info is only generated IF the socket appender initialized
properly, not when the message is created?

right, the LoggingEvent was coming over without the info. I realize it is
costly, and it will cause some interesting dilemmas for me since we can't
(economically) remotely configure our logging clients from our server...in
other words allow the user (at the server) to turn off location information
(at the client).

I like the idea of 'filtered' location information, especially if it means
producing LocationInformation only for, say, ERROR and FATAL Level's - i
will look those up.


thanks!
-scott

-Original Message-
From: Mark Womack [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, June 04, 2002 4:02 PM
To: 'Log4J Users List'
Subject: RE: SocketAppender and LoggingEvent data


Scott, the generation of the location information is deferred until it is
actually needed.  So, if you had your message include it, it would be
generated then.  If you have the SocketAppender include it (via the property
setting), it is generated before the event is pumped across the socket.
But, it is only generated once per logging event.

So, I am guessing that you were looking at a message on the server that had
the location information as part of the message, but the event had already
been sent across your socket (without the location information)?

You have probably heard it on this list before, but generating location
information for every logging event is costly performance-wise.  It adds up
if you are sending hundreds/thousands of events.  I posted some filters
previously that helped "target" specific logging events so that only some
generated location information.  I am hoping to get something equivalent
into an official future release.

-Mark

> -Original Message-
> From: Klein, Scott @ TW [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, June 04, 2002 10:10 AM
> To: 'Log4J Users List'
> Subject: RE: SocketAppender and LoggingEvent data
> 
> 
> so at the risk of looking like a complete idiot, here's the answer:
> 
> log4j.appender.SOCKET.locationInfo=true
> 
> doh!
> 
> missed the tree looking through the forest ;)
> 
> -Original Message-
> From: Klein, Scott @ TW [mailto:[EMAIL PROTECTED]]
> Sent: Monday, June 03, 2002 3:18 PM
> To: Log4J-User (E-mail)
> Subject: SocketAppender and LoggingEvent data
> 
> 
> I am using a SocketAppender to send log info to a central 
> server, however
> when I try to retrieve the LocationInformation (such as 
> method and class
> name) on the the server side I get ?'s as a result - however 
> they are being
> logged properly on the client side --- might this be an issue with the
> serialization?
> 
> ___
> Scott Klein 
> 
> L-3 Communications
> Telemetry-West
> 9020 Balboa Avenue
> San Diego, CA  92123-3507
> 
> 858.694.7787
> [EMAIL PROTECTED]
> 
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:   
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: 
> <mailto:[EMAIL PROTECTED]>
> 
> --
> To unsubscribe, e-mail:   
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: 
> <mailto:[EMAIL PROTECTED]>
> 

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




RE: Excluding one category from root configuration

2002-06-04 Thread Klein, Scott @ TW

appender additivity rule:

http://jakarta.apache.org/log4j/docs/manual.html#additivity

-Original Message-
From: Charlie Cano [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, June 04, 2002 3:16 PM
To: Log4j Mailing List (E-mail)
Subject: Excluding one category from root configuration


 

Hey all,

 

I'm trying to configure log4j in the following way:

 

I want every category with priority INFO or above to use, say Appender_A
EXCEPT one specific category.

 

Basically, I'm looking for something like "exclude catetory X" in the 
XML element of log4j.xml

 

Is there an easy way to do this?  

 

This is what I have now for my root tag:

 









 

How can I EXCLUDE anything from Category_X from going to the EVENT_LOG
appender?

 

- Charlie


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




RE: SocketAppender and LoggingEvent data

2002-06-04 Thread Klein, Scott @ TW

so at the risk of looking like a complete idiot, here's the answer:

log4j.appender.SOCKET.locationInfo=true

doh!

missed the tree looking through the forest ;)

-Original Message-
From: Klein, Scott @ TW [mailto:[EMAIL PROTECTED]]
Sent: Monday, June 03, 2002 3:18 PM
To: Log4J-User (E-mail)
Subject: SocketAppender and LoggingEvent data


I am using a SocketAppender to send log info to a central server, however
when I try to retrieve the LocationInformation (such as method and class
name) on the the server side I get ?'s as a result - however they are being
logged properly on the client side --- might this be an issue with the
serialization?

___
Scott Klein 

L-3 Communications
Telemetry-West
9020 Balboa Avenue
San Diego, CA  92123-3507

858.694.7787
[EMAIL PROTECTED]





--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




LocationInfo and SocketAppenders (was: SocketAppender and LoggingEvent data)

2002-06-04 Thread Klein, Scott @ TW

Apparently (according to the DTD anyway - see below) there is a
"includesLocationInformation" setting (which is supposed to be set to true
by default) that may also be causing the problem.

Has anyone successfully used the SocketAppender to transfer LocationInfo
with a LoggingEvent? If so, how???

excerpt from DTD:




http://jakarta.apache.org/log4j/"; 
  version(1.1|1.2) "1.2" 
  includesLocationInfo   (true|false) "true"
>

-----Original Message-
From: Klein, Scott @ TW [mailto:[EMAIL PROTECTED]]
Sent: Monday, June 03, 2002 3:18 PM
To: Log4J-User (E-mail)
Subject: SocketAppender and LoggingEvent data


I am using a SocketAppender to send log info to a central server, however
when I try to retrieve the LocationInformation (such as method and class
name) on the the server side I get ?'s as a result - however they are being
logged properly on the client side --- might this be an issue with the
serialization?

___
Scott Klein 

L-3 Communications
Telemetry-West
9020 Balboa Avenue
San Diego, CA  92123-3507

858.694.7787
[EMAIL PROTECTED]





--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




SocketAppender and LoggingEvent data

2002-06-03 Thread Klein, Scott @ TW

I am using a SocketAppender to send log info to a central server, however
when I try to retrieve the LocationInformation (such as method and class
name) on the the server side I get ?'s as a result - however they are being
logged properly on the client side --- might this be an issue with the
serialization?

___
Scott Klein 

L-3 Communications
Telemetry-West
9020 Balboa Avenue
San Diego, CA  92123-3507

858.694.7787
[EMAIL PROTECTED]





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




RE: Log4j in multiple JVM's

2002-06-03 Thread Klein, Scott @ TW

Mike -

what if you synchronized the file (subclassing FileAppender)? Aside from the
performance implications, would that work?

-Original Message-
From: Mike Devereaux [mailto:[EMAIL PROTECTED]]
Sent: Monday, June 03, 2002 1:44 PM
To: [EMAIL PROTECTED]
Subject: RE: Log4j in multiple JVM's


No - you will get interleaved/mixed results from within the various
JVMs, evne on one host.
If you use a SocketAppender, since src and dest ports are on the same
host, it should be more than fast enough, and the dest process, a small
one, can be writing all the messages to a single file.  That's my
recommendation (on limited experience),  If you're within a J2EE
environment I would instead recommend the JMSAppender.

>>> [EMAIL PROTECTED] 06/03/02 03:37PM >>>
Now. In my case all the JVM's are running on the same Machine.
I want to have one logfile per machine regardless of the number of
jvm's
or AppServer running on them. will FileAppender be fine?

-Original Message-
From: Mike Devereaux [mailto:[EMAIL PROTECTED]] 
Sent: Monday, June 03, 2002 4:32 PM
To: [EMAIL PROTECTED] 
Subject: Re: Log4j in multiple JVM's

If you are using multiple JVMs I would recommend a JMSAppender or a
SocketAppender.

>>> [EMAIL PROTECTED] 06/03/02 03:27PM >>>
Hi all,

 

Can I have log4j's running in multiple jvm's write to the same file? 

 

Or do I need to have a single log file for each JVM?

 

Regards,

Rajan

 

 

 


--
To unsubscribe, e-mail:

For additional commands, e-mail:



--
To unsubscribe, e-mail:  

For additional commands, e-mail:



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

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




RE: Log4j in multiple JVM's

2002-06-03 Thread Klein, Scott @ TW

it is possible, but not by using a FileAppender (as far as I know),

you are going to have to use the SocketAppender to send logs out to a log
server which writes to a file.

there have been examples in the past - i do have a zip file from a fairly
old post with a LoggingServer and SocketNodeExt classes which I have
modified for my own use...notify me away from this list if you would like
it.

of course the JMSAppender (if you want to use a JMS server is another
approach that probably won't require quite as much implementation work)

-Original Message-
From: Rajan Annadurai [mailto:[EMAIL PROTECTED]]
Sent: Monday, June 03, 2002 1:27 PM
To: [EMAIL PROTECTED]
Subject: Log4j in multiple JVM's


Hi all,

 

Can I have log4j's running in multiple jvm's write to the same file? 

 

Or do I need to have a single log file for each JVM?

 

Regards,

Rajan

 

 

 


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




RE: LogManager

2002-05-30 Thread Klein, Scott @ TW

can you put up your config file?

i think you are describing the same issue i had - it has to do with the
"appender additivity rule" perhaps.

-Original Message-
From: Anand M S [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 30, 2002 3:37 PM
To: [EMAIL PROTECTED]
Subject: LogManager



HI all,
 I'm trying to use wrapper classes for logging, I have 5 different loggers,
when I try to log, Logger.log(Priority, msg); then the message  is written
to all log files, just before I'm printing logger name, but
LogManager.getCurrentLoggers() returns all five loggers, what could be the
possible reason, what is the significance of log manager?

Thanks,
Anand



-
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup

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




RE: SocketAppender (was: console/file config)

2002-05-30 Thread Klein, Scott @ TW

I am starting to work with these as well...I have a simple example running
but there are some little 'tricks' --- like you get into an infinite loop if
everything is not set up properly because your SocketNodes start sending
their messages out to themselves (thats fun!).

Anyway, I got a zip file from the mail archives last night with some
'extension' classes that I have yet to get in depth with. since i don't want
to attach a zip to the list posting, if you would like a copy e-mail me
directly.


scott

-Original Message-
From: Sundararaman, Anand [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 29, 2002 9:19 PM
To: Log4J Users List
Subject: RE: SocketAppender (was: console/file config)


Hi Mark,
  Can you please give me one example on how to use the SocketNode class
on the server side.

Thanks
Anand

> -Original Message-
> From: Mark Womack [SMTP:[EMAIL PROTECTED]]
> Sent: Wednesday, May 29, 2002 10:56 PM
> To:   'Log4J Users List'
> Subject:  RE: SocketAppender (was: console/file config)
> 
> Look at the SocketNode class.  You can use this class on the receiving end
> to read the logging events.
> 
> -Mark
> 
> > -Original Message-
> > From: Sundararaman, Anand [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, May 29, 2002 7:18 AM
> > To: Log4J Users List
> > Subject: RE: console/file config 
> > 
> > 
> > 
> > Hi,
> > I am new to Log4j. Please help me out. I am using 
> > SocketAppender class
> > to send a logging message to a port on another machine. Can 
> > anyone let me
> > know how to write my SocketServer to get the same message on 
> > the server
> > side.
> > 
> > It is Urgent.
> > 
> > Thanks in advance
> > Anand
> > WARNING: The information in this message is confidential and 
> > may be legally
> > privileged. It is intended solely for the addressee.  Access 
> > to this message
> > by anyone else is unauthorised.  If you are not the intended 
> > recipient, any
> > disclosure, copying, or distribution of the message, or any action or
> > omission taken by you in reliance on it, is prohibited and 
> > may be unlawful.
> > Please immediately contact the sender if you have received 
> > this message in
> > error. Thank you.- HCL Perot Systems
> > 
> > --
> > To unsubscribe, e-mail:   
> > 
> > For additional commands, e-mail: 
> > 
> > 
> 
> --
> To unsubscribe, e-mail:
> 
> For additional commands, e-mail:
> 
WARNING: The information in this message is confidential and may be legally
privileged. It is intended solely for the addressee.  Access to this message
by anyone else is unauthorised.  If you are not the intended recipient, any
disclosure, copying, or distribution of the message, or any action or
omission taken by you in reliance on it, is prohibited and may be unlawful.
Please immediately contact the sender if you have received this message in
error. Thank you.- HCL Perot Systems

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

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




JMSAppender configuration...

2002-05-14 Thread Klein, Scott @ TW

I have searched for any comments on how to set up the JMSAppender
appropriately, primarily the binding information of the JMS server to no
avail, can someone point me in the right direction or throw a config file my
way?

tia,
scott

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